The Linux Newbie Guide  ⇒    Fundamentals     Advanced     Supplement   Command Index   ENG⇒中
All rights reserved, please indicate the source when citing
 









The fgrep command, also known as grep -F, is a Linux command-line utility used to search for a fixed string (literal string) within files or input streams. It performs a simple pattern matching based on the exact string you provide and does not interpret the string as a regular expression. This can be useful when you want to search for a specific string without worrying about regular expression metacharacters.

Example:
$ fgrep 'W.C.' /usr/share/dict/words ←Searching for the string 'W.C.' in the dictionary file
W.C.
W.C.T.U.
Y.W.C.A.

The fgrep command is particularly useful when you need to perform exact string searches without the need for complex regular expressions. It's faster and simpler in cases where regular expressions are not necessary.

For more grep examples, explanations, and options, refer to the provided link.
For more fgrep examples, explanations, and options, refer to the provided link.