Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 1 down vote accepted

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/

share|improve this answer
I run the ./ack -r '\<([0-9]{1,3}\.){3}[0-9]{1,3}\>' /etc/* but I not get anything why? – lidia Sep 7 '10 at 10:51
Hmm, hopefully, helped. – nik Sep 7 '10 at 11:37

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.