Search

From KevinWiki

Revision as of 05:44, 29 September 2008 by Kevin (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Search a String in a File

grep -H "<keyword to search>" <filename>
grep -H "Invalid" /var/log/auth.log


Search a String in a Large Number of Files

for i in `find /<directory to search>/`; do grep -H "<keyword to search>" $i; done
for i in `find /home/user/`; do grep -H "Subject" $i; done
Personal tools