

I am using grep to match a pattern, but the output is strange. DESCRIPTION The grep utility searches any given input files, selecting lines. I tried renaming it to /disk2/user/test/logs/, but it still says it is a binary file. This is equivalent to -binary-filestext and it should show the matches in binary files. Pipe binary file matches grep results to file. I imagine somewhere in the log file are some control characters that are tricking grep, but the beginning and end of the file looks like normal text. The issue I'm facing is that grep finds the line but does not give it to me, instead printing message about it being a binary file: > grep -n 6307459 /disk2/user/test/logs/-23-42-52-7224.logīinary file /disk2/user/test/logs/-23-42-52-7224.log matches I'm using grep to find the line number of the occurrence and then using head and tail to get the section I'm interested in reviewing.

Warning: grep -binary-filestext might output binary. ) will show the same 'Binary file (standard input) matches' message.
#Grep binary file matches windows
The only thing that sets them apart is that they were created by a Windows application so I assume theres some encoding difference. I cant think why since the cat output itself is normal. It is huge and I need to find around a million lines starting from the occurrence of a string 6307459 in the log file and view it in emacs. If TYPE is text, grep processes a binary file as if it were text this is equivalent to the -a option. Doing it via the command line or stepping through the setup (i.e. Im trying to grep an old irc log by 'cat /irclogs/old/ocremix.log grep +' but this returns Binary file (standard input) matches instead of grepping it. I'm on Centos 5 Linux and using GNU grep v2.5.1 and looking at a 36GB log file.
