Print lines that match fixed-string patterns.
Synopsis
fgrep [OPTION]... PATTERN [FILE]...
Description
Equivalent to grep -F: search for PATTERN as a set of fixed (literal) strings rather than a regular expression, in each FILE. With no FILE, or when FILE is -, read standard input.
Options
-i, --ignore-case Ignore case distinctions.
-v, --invert-match Select non-matching lines.
-c, --count Print only a count of matching lines.
-l, --files-with-matches Print only names of files with matches.
-n, --line-number Print line number with output lines.
-r, -R, --recursive Search directories recursively.
Examples
$ fgrep 'a.b*c' file.txt
Search for the literal string 'a.b*c', with no regex interpretation.
Notes
Identical to grep -F in this shell. See grep --help for the full option list.
See Also
grep, egrep, rg