Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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, superuser.com/questions/185582/ack-tool-like-grep-problem 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

 
discard

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.