Grep Cheat Sheet
Grep cheat sheet with the most common and useful Grep commands.
grep  is a command-line utility for searching plain-text data sets for lines that match a regular expression. That makes grep one of the essential Linux commands.
The general grep command syntax:
grep [OPTIONS] PATTERN [FILE...]
grep for foo in bar.txt:
$ grep foo bar.txt
grep recursively for foo in all subdirectories:
$ grep -R "foo" .
grep recursively (case insensitive) for foo in all subdirectories:
$ grep -Ri "foo" .
grep recursively for foo in all subdirectories and return the file name only:
$ grep -R -I "foo" .