fgrep Command Examples

Matches fixed strings in files. Equivalent to grep -F. More information: https://www.gnu.org/software/grep/manual/grep.html.

fgrep {{search_string}} {{path/to/file}}

fgrep {{[-x|--line-regexp]}} {{search_string}} {{path/to/file1 path/to/file2 ...}}

fgrep {{[-c|--count]}} {{search_string}} {{path/to/file}}

fgrep {{[-n|--line-number]}} {{search_string}} {{path/to/file}}

fgrep {{[-v|--invert-match]}} {{search_string}} {{path/to/file}}

fgrep {{[-l|--files-with-matches]}} {{search_string}} {{path/to/file1 path/to/file2 ...}}