Skip to main content
1 of 6

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 as :

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