Alex Rivera | Logout

"grep: line too long" error message

Asked 2010-09-07T09:01:19.727
10

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 why I get this?

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

1 Answer

24

The find/xargs solution didn't work for me, but resulted in the same error.

I solved this problem by using the -I grep option (ignore binary files). In my case there must have been a binary file in the list of files to search that had no linebreaks, so grep tries to read in a gigantic line that is too big. That's my guess at what this error means.

I got the idea from: http://web.archiveorange.com/archive/v/am8x7wI0r0243prrmYd4

This might not work for you of course if there's a text file with a line that is too long.

answered 2011-07-25T13:21:57.187

Your Answer