NET 4000 Chapter Notes - Chapter 1.12.7: Grep, Regular Expression
Document Summary
The grep command searches through file text for specific words or character patterns. The following table describes the grep, egrep, and fgrep commands and several of their options: Searches through files for a specified character string. By default, grep is context sensitive and displays the string in the context of the line containing the string. A [number] prints a specified number of lines following the matching lines. A searches binary (executable) files as though they were text files. B [number] prints a specified number of lines before the matching lines. C [number] prints a specified number of lines of context around the matching lines. C shows the number of matches of the string for the file. E uses regular expressions for the text pattern. F searches for multiple strings using a file that lists the string patterns. F uses a file as the source for the string patterns. L lists just the names of the files with a match.