Saturday, March 11, 2006

GREP TEXT NOT BINARY

GREP TEXT NOT BINARY

In some directories such as /etc you have a mix of file types.
You may want to grep out a string from one of the files but
don't want to worry about the binaries, data, etc. To accomplish
this, searching only text files do this:

grep `file * | egrep 'script|text' | awk -F: '{print $1}'`

No comments: