Search a string in files with grep, egrep, fgrep, pgrep, and locale — Cheat Sheet Linux
grep
grep <OPTIONS> <PATTERN> <FILENAME>
displays the lines of a file corresponding to a specified pattern.
The arguments are:
-c
(or--count
): displays a count of matching lines for each input file,-C <NUMBER>
(or--context
): displays context lines between continuous groups of matches,-E <PATTERN>
(or--extended-regexp
): uses the pattern as an extended regular expression,