The following are the most frequently used grep options and examples:
1. Grep lines that contain the word "error" in the logfile
2. Negation. Grep lines that do not contain the word "error" in the file
grep error logiflename
3. count the number of error lines in log file.
grep -v error logfilename
4. case insensitive grepping. Matches both upper case, lower case patterns.
grep -c error logifle
5. Print only file names that contain the specified pattern.
grep -i error logifle
grep -l error logfiles*