This directory of Linux commands is from Linux in a Nutshell, 5th Edition.
Click on any of the 687 commands below to get a description and list of available options. All links in the command summaries point to the online version of the book on Safari Bookshelf.
fgrep [options] string [files]
Search one or more files for lines that match the specified text string. Exit status is 0 if any lines match, 1 if not, and 2 for errors. fgrep is faster than normal grep searches, but less flexible: it can only find fixed text, not regular expressions.
See grep for the list of available options. Also see egrep.
Print lines in file that don't contain any spaces:
fgrep -v ' ' file
Print lines in file that contain the words in the file spell_list:
fgrep -f spell_list file