.TH zgrep "" "" "Command"
.PC "Search compressed files for a regular expression"
\fBzgrep [\-abcefhilnsvxy\fB] [\fIpattern\^\fB] [\fIfile ...\fB]\fR
.PP
.HS
.SH Options:
.IC \fB\-a\fR
Extra metacharacters supported (`(...)', `|', `+', and `?')
.IC \fB\-b\fR
Each output line has block number of match
.IC \fB\-c\fR
Print only count of matching lines
.IC \fB\-e\fR
Next argument is pattern
.IC \fB\-f\fR
Next argument is file containing one pattern per line
.IC \fB\-h\fR
Suppress printing of file names on matched lines
.IC \fB\-i\fR
Ignore case when matching letters in \fIpattern\fR
.IC \fB\-l\fR
Print only names of files containing matches
.IC \fB\-n\fR
Print line number of file with each matched line output
.IC \fB\-s\fR
Suppress output, just return status
.IC \fB\-v\fR
Negate sense of match
.IC \fB\-x\fR
Exact match (don't expand metacharacters)
.IC \fB\-y\fR
Lower-case letters in \fIpattern\fR match only upper-case
.Pp
The \fIpattern\fR is a regular expression roughly like that found in \fBed\fR.
If no \fIfile\fR is specified, stdin is read.
.HE
The command
.B zgrep
searches for a string within a file that had been compressed by
.BR gzip .
It behaves exactly like
.BR grep ,
except that it de-compresses compressed files ``on the fly.''
For details on the options to
.B zgrep
see the Lexicon entry for
.BR grep .
.SH "See Also"
.Xr "commands," commands
.Xr "grep," grep
.Xr "gzip" gzip
