Getting rid of 'grep: line too long'

3

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?

lidia

Posted 2010-09-07T10:07:32.823

Reputation: 629

Answers

1

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/

Janne Pikkarainen

Posted 2010-09-07T10:07:32.823

Reputation: 6 717

I run the ./ack -r '<([0-9]{1,3}.){3}[0-9]{1,3}>' /etc/* but I not get anything why? – lidia – 2010-09-07T10:51:13.113

Hmm, hopefully, http://superuser.com/questions/185582/ack-tool-like-grep-problem helped.

– nik – 2010-09-07T11:37:03.253

0

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

raineater

Posted 2010-09-07T10:07:32.823

Reputation: 9