Grep for literal strings Grep for literal strings unix unix

Grep for literal strings


You can use grep for that, with the -F option.

-F, --fixed-strings       PATTERN is a set of newline-separated fixed strings


That's either fgrep or grep -F which will not do regular expressions. fgrep is identical to grep -F but I prefer to not have to worry about the arguments, being intrinsically lazy :-)

grep   ->  grepfgrep  ->  grep -F  (fixed)egrep  ->  grep -E  (extended)rgrep  ->  grep -r  (recursive, on platforms that support it).