source: trunk/minix/man/man1/grep.1@ 9

Last change on this file since 9 was 9, checked in by Mattia Monga, 13 years ago

Minix 3.1.2a

File size: 1.3 KB
Line 
1.TH GREP 1
2.SH NAME
3grep \- search a file for lines containing a given pattern
4.SH SYNOPSIS
5\fBgrep\fR [\fB\-elnsv\fR] \fIpattern\fR [\fIfile\fR] ...\fR
6.br
7.de FL
8.TP
9\\fB\\$1\\fR
10\\$2
11..
12.de EX
13.TP 20
14\\fB\\$1\\fR
15# \\$2
16..
17.SH OPTIONS
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"
25.SH EXAMPLES
26.EX "grep mouse file " "Find lines in \fIfile\fP containing \fImouse\fP"
27.EX "grep [0\-9] file" "Print lines containing a digit"
28.SH DESCRIPTION
29.PP
30.I Grep
31searches one or more files (by default, \fIstdin\fR) and selects out
32all the lines that match the pattern.
33All the regular expressions accepted by
34.I ed
35and
36.I mined
37are allowed.
38In 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
41one of them.
42Parentheses can be used for grouping.
43If a match is found, exit status 0 is returned.
44If no match is found, exit status 1 is returned.
45If an error is detected, exit status 2 is returned.
46.SH "SEE ALSO"
47.BR cgrep (1),
48.BR fgrep (1),
49.BR sed (1),
50.BR awk (9).
Note: See TracBrowser for help on using the repository browser.