Skip to main content
3 of 6
added 116 characters in body

The -F option or --fixed-string, as you noted, disable the regexp engine and search for literal strings. It is usefull to disable pattern that are valid regular expression as :

grep -Fe '[warn]' app.log

The [warn] pattern is a valid Basic Regular Expression (BRE) and so without the -F option grep will search and catch any line with at least one between w,a, r, n.

If you have more pattern to search you can use the -e option multiple times:

grep -Fe '[warn]' -e '[debug]' -e '[err]' app.log

The -x, --line-regex option can also be useful in this context as it takes a line only if it matches the whole