O'Reilly logo

Linux Shells by Example by Ellie Quigley

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

3.6. grep with Options

The grep command has a number of options that control its behavior. Not all versions of UNIX support exactly the same options, so be sure to check your man pages for a complete list. The Gnu version of grep added a number of new options and alternative ways to use the options, shown in Table 3.6. The Gnu grep options work with all the different variants of grep, including grep -G, -E, and -F, as shown in Table 3.7.

Table 3.6. Gnu grep Options
Option What It Does
-b Precedes each line by the block number on which it was found. This is sometimes useful in locating disk block numbers by context.
-c Displays a count of matching lines rather than displaying the lines that match.
-h Does not display filenames.
-i Ignores the ...

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