I used the following syntax in order to find IP address under /etc

(answered by Dennis Williamson in superuser site)

but I get the message "grep: line too long"

someone have idea how to ignore this message and Continue searching other IP's address
because the message that I get stop the IP's searching -:(

(maybe because binary files?)

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

can I get solution for this problem? maybe somthing that replace the grep ?

lidia

link|improve this question

feedback

2 Answers

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/

link|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
feedback

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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