grep
Search for patterns in files using regular expressions (https://www.gnu.org/software/grep/)
To search for a pattern in a file
To search recursively in a directory
grep -r <pattern> <directory>
To search case-insensitively
To show line numbers with matches
To list only filenames that contain matches
grep -l <pattern> <files>
To count the number of matching lines
To show lines that do not match
To match whole words only
To use extended regular expressions (ere)
To match a literal string (no regex)
To show num lines after each match
grep -A <num> <pattern> <file>
To show num lines before each match
grep -B <num> <pattern> <file>
To show num lines of context around each match
grep -C <num> <pattern> <file>
To search only files matching a glob
grep --include='<glob>' -r <pattern> <directory>
To print only the matching part of each line