3 grep \- search a file for a pattern
17 (standard input default)
18 for lines that match the
20 a regular expression as defined in
22 with the addition of a newline character as an alternative
25 with lowest precedence.
26 Normally, each line matching the pattern is `selected',
27 and each selected line is copied to the standard output.
31 Print only a count of matching lines.
35 Do not print file name tags (headers) with output lines.
38 The following argument is taken as a
40 This option makes it easy to specify patterns that
41 might confuse argument parsing, such as
45 Ignore alphabetic case distinctions. The implementation
46 folds into lower case all letters in the pattern and input before
47 interpretation. Matched lines are printed in their original form.
50 (ell) Print the names of files with selected lines; don't print the lines.
53 Print the names of files with no selected lines;
58 Mark each printed line with its line number counted in its file.
61 Produce no output, but return status.
64 Reverse: print lines that do not match the pattern.
67 The pattern argument is the name of a file containing regular
68 expressions one per line.
71 Don't buffer the output: write each output line as soon as it is discovered.
74 Output lines are tagged by file name when there is more than one
76 (To force this tagging, include
78 as a file name argument.)
80 Care should be taken when
81 using the shell metacharacters
86 it is safest to enclose the
89 .BR \&\|' \|.\|.\|.\| ' .
90 An expression starting with '*'
91 will treat the rest of the expression
92 as literal characters.
94 .B /usr/local/plan9/src/cmd/grep
102 Exit status is null if any lines are selected,
103 or non-null when no lines are selected or an error occurs.