Finding relevant word and excluding irrelevant word
grep xception logfile.txt | grep -v ERRORIf you are looking to count a particular word in log file
grep -c "Error" logfile.txtGetting multiple lines around matched text
grep --context=6 xception logfile.txtgrep -C 2 'hello' *
Finding any of the multiple texts strings in log file
egrep 'Error|Exception|Debug' logfile.txtFinding within .gz (zipped) file without unzipping them
zgrep -i Error *.gzDisplay the file names that matches the given pattern
grep -l ERROR *.logRelated Posts
Effective use of Tail / Find / Grep / Sed / Awk with Application logs
Unix Shell Scripts for Log Monitoring , Production and Application Support
Best Practices for Application Support on Unix / Linux