When I search for log files with an error message using grep error *log, it returns a list of log files
$grep error *log
Binary file out0080-2011.01.07-12.38.log matches
Binary file out0081-2011.01.07-12.38.log matches
Binary file out0082-2011.01.07-12.38.log matches
Binary file out0083-2011.01.07-12.38.log matches
However, these are text files, not binary files.
I'm not sure why they are considered binary, the first few lines contain the following messages without error:
out0134
-catch_rsh /opt/gridengine/default/spool/compute-0-17/active_jobs/327708.1/pe_hostfile
compute-0-17
I would like to grep the contents of the returned files for the error message and return the file names with the message.
How can I grep the contents of the returned files and not this list of returned files, how does this happen grep error *log | grep foo?
source
share