O'Reilly logo

Mac OS X Tiger in a Nutshell by Jason McIntosh, Chuck Toporek, Chris Stone, Andy Lester

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

fgrep

Synopsis

fgrep [options] pattern [files]

Search one or more files for lines that match a literal text string pattern. Exit status is 0 if any lines match, 1 if not, and 2 for errors.

See grep for the list of available options. Also see egrep .

Examples

Print lines in file that don't contain any spaces:

$ fgrep -v ''
                     file

Print lines in file that contain the words in spell_list:

$ fgrep -f spell_list
                     file

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required