Search

From KevinWiki

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