Search

From KevinWiki

(Difference between revisions)
Jump to: navigation, search
Kevin (Talk | contribs)
(New page: Category:Linux ==Search a String in a File== <pre> grep -H "<keyword to search>" <filename> </pre> <pre> grep -H "Invalid" /var/log/auth.log </pre> ==Search a String in a Large Num...)

Latest revision as of 05:44, 29 September 2008


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