When to Use Fgrep?

fgrep is the same as grep -F. Direct invocation as either egrep or fgrep is deprecated, but is provided to allow historical applications that rely on them to run unmodified. You use fgrep or grep -F if you don't want the grepped string to be interpreted as a pattern.

What is fgrep command used for?

The fgrep command searches the input files specified by the File parameter (standard input by default) for lines that match a pattern. The fgrep command searches specifically for Pattern parameters that are fixed strings.

What is the difference between fgrep and grep?

The grep filter searches a file for a particular pattern of characters and displays all lines that contain that pattern. The fgrep filter searches for fixed-character strings in a file or files.

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.