3 grep \- search a file for lines containing a given pattern
5 \fBgrep\fR [\fB\-elnsv\fR] \fIpattern\fR [\fIfile\fR] ...\fR
18 .FL "\-e" "\fB\-e \fIpattern\fR is the same as \fIpattern\fP
19 .FL "\-c" "Print a count of lines matched"
20 .FL "\-i" "Ignore case"
21 .FL "\-l" "Print file names, no lines"
22 .FL "\-n" "Print line numbers"
23 .FL "\-s" "Status only, no printed output"
24 .FL "\-v" "Select lines that do not match"
26 .EX "grep mouse file " "Find lines in \fIfile\fP containing \fImouse\fP"
27 .EX "grep [0\-9] file" "Print lines containing a digit"
31 searches one or more files (by default, \fIstdin\fR) and selects out
32 all the lines that match the pattern.
33 All the regular expressions accepted by
38 In addition, + can be used instead of \(** to mean 1 or more occurrences,
39 ? can be used to mean 0 or 1 occurrences, and
40 | can be used between two regular expressions to mean either
42 Parentheses can be used for grouping.
43 If a match is found, exit status 0 is returned.
44 If no match is found, exit status 1 is returned.
45 If an error is detected, exit status 2 is returned.