Previous Section  < Day Day Up >  Next Section

Chapter 4. The grep Family

The grep family consists of the commands grep, egrep, and fgrep. The grep command globally searches for regular expressions in files and prints all lines that contain the expression. The egrep and fgrep commands are simply variants of grep. The egrep command is an extended grep, supporting more regular expression metacharacters. The fgrep command, called fixed grep, and sometimes fast grep, treats all characters as literals; that is, regular expression metacharacters aren't special—they match themselves. The Free Software Foundation provides a free version of grep, called GNU grep. These versions of grep are the ones used on Linux systems, and can be found in /usr/xpg4/bin on Sun's Solaris OS. The GNU version of grep has extended the basic regular expression metacharacter set, added POSIX compliancy, and included a number of new command-line options. They also provide a recursive grep called rgrep for descending entire directory trees.

    Previous Section  < Day Day Up >  Next Section