March 2002
Beginner
504 pages
10h 47m
English
The grep command lets you locate the lines in a file that contain a particular word or a phrase. The word grep is short for globally regular expression print. The command is derived from a feature of the original UNIX text editor, ed. To find a word in ed, the following command was used:
g/word/p
Here word is a regular expression. For those readers who are not familiar with regular expressions, Chapter 16, “Filtering Text Using Regular Expressions,” discusses them in detail. This particular ed command was used widely in shell scripts, thus it was factored into its own command called grep. In this section, you will look at the grep command along with some of its most commonly used options.
The basic syntax of the ...
Read now
Unlock full access