Getting rid of 'grep: line too long'

I used the following syntax in order to find the IP address under /etc (answered by Dennis Williamson on the Super User site), but I get the message

grep: line too long

How can I get it to ignore this message and continue searching other IP addresses because the message that I get stop the IP addresses searching (maybe because binary of files?) -:(

 grep -Er '\<([0-9]{1,3}\.){3}[0-9]{1,3}\>' /etc/ grep: line too long 

Is there a solution for this problem? Maybe somthing that replaces the grep?

2 Answers

Some of the files in your /etc/ then contain VERY long lines without linebreaks, so grep skips them.

You can try ack instead. With it the syntax would be

ack -r '\<([0-9]{1,3}\.){3}[0-9]{1,3}\>' /etc/

2

The target of the grep search probably should be /etc/hosts (i.e. not /etc/)...

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like