EnderUNIX Team.


EnderUNIX tips

Mail to My Friend , Home Page

[ Shell Scripting ]

"GREP TEXT NOT BINARY" - Ülkü SAYILAN - (2005-02-01 15:30:20)   [4608]



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}'`

Mail to My Friend , Home Page