2025-02-24 06:03:38 +01:00
|
|
|
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2.
|
2025-02-24 06:05:15 +01:00
|
|
|
.TH ZGREP "1" "January 2025" "zutils 1.14" "User Commands"
|
2025-02-24 04:42:45 +01:00
|
|
|
.SH NAME
|
2025-02-24 05:47:56 +01:00
|
|
|
zgrep \- search compressed files for a regular expression
|
2025-02-24 04:42:45 +01:00
|
|
|
.SH SYNOPSIS
|
|
|
|
.B zgrep
|
2025-02-24 05:49:30 +01:00
|
|
|
[\fI\,options\/\fR] \fI\,<pattern> \/\fR[\fI\,files\/\fR]
|
2025-02-24 04:42:45 +01:00
|
|
|
.SH DESCRIPTION
|
2025-02-24 05:59:17 +01:00
|
|
|
zgrep is a front end to the program grep that allows transparent search
|
|
|
|
on any combination of compressed and uncompressed files. If any file
|
|
|
|
given is compressed, its decompressed content is used. If a file given
|
2025-02-24 05:01:08 +01:00
|
|
|
does not exist, and its name does not end with one of the known
|
|
|
|
extensions, zgrep tries the compressed file names corresponding to the
|
2025-02-24 06:03:38 +01:00
|
|
|
formats supported until one is found. If a file fails to decompress, zgrep
|
|
|
|
continues searching the rest of the files.
|
2025-02-24 05:53:08 +01:00
|
|
|
.PP
|
2025-02-24 05:57:59 +01:00
|
|
|
If a file is specified as '\-', data are read from standard input,
|
|
|
|
decompressed if needed, and fed to grep. Data read from standard input
|
|
|
|
must be of the same type; all uncompressed or all in the same
|
2025-02-24 05:59:17 +01:00
|
|
|
compressed format.
|
2025-02-24 05:40:39 +01:00
|
|
|
.PP
|
2025-02-24 05:57:59 +01:00
|
|
|
If no files are specified, recursive searches examine the current
|
|
|
|
working directory, and nonrecursive searches read standard input.
|
|
|
|
.PP
|
2025-02-24 06:00:49 +01:00
|
|
|
\&'zgrep \fB\-\-verbose\fR \fB\-V\fR' prints the version of the grep program used.
|
|
|
|
.PP
|
|
|
|
The formats supported are bzip2, gzip, lzip, xz, and zstd.
|
2025-02-24 04:42:45 +01:00
|
|
|
.PP
|
2025-02-24 05:01:08 +01:00
|
|
|
Exit status is 0 if match, 1 if no match, 2 if trouble.
|
2025-02-24 05:59:17 +01:00
|
|
|
Some options only work if the grep program used supports them.
|
2025-02-24 04:42:45 +01:00
|
|
|
.SH OPTIONS
|
|
|
|
.TP
|
2025-02-24 05:01:08 +01:00
|
|
|
\fB\-\-help\fR
|
2025-02-24 04:42:45 +01:00
|
|
|
display this help and exit
|
|
|
|
.TP
|
|
|
|
\fB\-V\fR, \fB\-\-version\fR
|
|
|
|
output version information and exit
|
2025-02-24 05:01:08 +01:00
|
|
|
.TP
|
|
|
|
\fB\-a\fR, \fB\-\-text\fR
|
|
|
|
treat all files as text
|
|
|
|
.TP
|
|
|
|
\fB\-A\fR, \fB\-\-after\-context=\fR<n>
|
|
|
|
print <n> lines of trailing context
|
|
|
|
.TP
|
|
|
|
\fB\-b\fR, \fB\-\-byte\-offset\fR
|
|
|
|
print the byte offset of each line
|
|
|
|
.TP
|
|
|
|
\fB\-B\fR, \fB\-\-before\-context=\fR<n>
|
|
|
|
print <n> lines of leading context
|
|
|
|
.TP
|
|
|
|
\fB\-c\fR, \fB\-\-count\fR
|
|
|
|
only print a count of matching lines per file
|
|
|
|
.TP
|
|
|
|
\fB\-C\fR, \fB\-\-context=\fR<n>
|
|
|
|
print <n> lines of output context
|
|
|
|
.TP
|
2025-02-24 05:56:02 +01:00
|
|
|
\fB\-\-color[=\fR<when>]
|
|
|
|
show matched strings in color
|
|
|
|
.TP
|
2025-02-24 05:01:08 +01:00
|
|
|
\fB\-e\fR, \fB\-\-regexp=\fR<pattern>
|
|
|
|
use <pattern> as the pattern to match
|
|
|
|
.TP
|
|
|
|
\fB\-E\fR, \fB\-\-extended\-regexp\fR
|
|
|
|
<pattern> is an extended regular expression
|
|
|
|
.TP
|
|
|
|
\fB\-f\fR, \fB\-\-file=\fR<file>
|
|
|
|
obtain patterns from <file>
|
|
|
|
.TP
|
|
|
|
\fB\-F\fR, \fB\-\-fixed\-strings\fR
|
|
|
|
<pattern> is a set of newline\-separated strings
|
|
|
|
.TP
|
2025-02-24 06:01:46 +01:00
|
|
|
\fB\-G\fR, \fB\-\-basic\-regexp\fR
|
|
|
|
<pattern> is a basic regular expression (default)
|
|
|
|
.TP
|
2025-02-24 05:01:08 +01:00
|
|
|
\fB\-h\fR, \fB\-\-no\-filename\fR
|
2025-02-24 06:00:49 +01:00
|
|
|
suppress the prefixing file name on output
|
2025-02-24 05:01:08 +01:00
|
|
|
.TP
|
|
|
|
\fB\-H\fR, \fB\-\-with\-filename\fR
|
2025-02-24 06:00:49 +01:00
|
|
|
print the file name for each match
|
2025-02-24 05:01:08 +01:00
|
|
|
.TP
|
|
|
|
\fB\-i\fR, \fB\-\-ignore\-case\fR
|
|
|
|
ignore case distinctions
|
|
|
|
.TP
|
|
|
|
\fB\-I\fR
|
|
|
|
ignore binary files
|
|
|
|
.TP
|
|
|
|
\fB\-l\fR, \fB\-\-files\-with\-matches\fR
|
|
|
|
only print names of files containing matches
|
|
|
|
.TP
|
|
|
|
\fB\-L\fR, \fB\-\-files\-without\-match\fR
|
|
|
|
only print names of files containing no matches
|
|
|
|
.TP
|
2025-02-24 06:01:46 +01:00
|
|
|
\fB\-\-label=\fR<label>
|
|
|
|
use <label> as file name for standard input
|
|
|
|
.TP
|
|
|
|
\fB\-\-line\-buffered\fR
|
|
|
|
flush output on every line
|
|
|
|
.TP
|
2025-02-24 05:01:08 +01:00
|
|
|
\fB\-m\fR, \fB\-\-max\-count=\fR<n>
|
|
|
|
stop after <n> matches
|
|
|
|
.TP
|
2025-02-24 05:51:09 +01:00
|
|
|
\fB\-M\fR, \fB\-\-format=\fR<list>
|
2025-02-24 05:52:24 +01:00
|
|
|
process only the formats in <list>
|
2025-02-24 05:51:09 +01:00
|
|
|
.TP
|
2025-02-24 05:01:08 +01:00
|
|
|
\fB\-n\fR, \fB\-\-line\-number\fR
|
|
|
|
print the line number of each line
|
|
|
|
.TP
|
2025-02-24 05:43:00 +01:00
|
|
|
\fB\-N\fR, \fB\-\-no\-rcfile\fR
|
|
|
|
don't read runtime configuration file
|
|
|
|
.TP
|
2025-02-24 05:01:08 +01:00
|
|
|
\fB\-o\fR, \fB\-\-only\-matching\fR
|
|
|
|
show only the part of a line matching <pattern>
|
|
|
|
.TP
|
2025-02-24 05:51:09 +01:00
|
|
|
\fB\-O\fR, \fB\-\-force\-format=\fR<fmt>
|
2025-02-24 06:02:19 +01:00
|
|
|
force the input format
|
2025-02-24 05:51:09 +01:00
|
|
|
.TP
|
2025-02-24 06:01:46 +01:00
|
|
|
\fB\-P\fR, \fB\-\-perl\-regexp\fR
|
|
|
|
<pattern> is a Perl regular expression
|
|
|
|
.TP
|
|
|
|
\fB\-q\fR, \fB\-\-quiet\fR, \fB\-\-silent\fR
|
2025-02-24 05:01:08 +01:00
|
|
|
suppress all messages
|
|
|
|
.TP
|
|
|
|
\fB\-r\fR, \fB\-\-recursive\fR
|
|
|
|
operate recursively on directories
|
|
|
|
.TP
|
2025-02-24 05:57:59 +01:00
|
|
|
\fB\-R\fR, \fB\-\-dereference\-recursive\fR
|
|
|
|
recursively follow symbolic links
|
|
|
|
.TP
|
2025-02-24 05:01:08 +01:00
|
|
|
\fB\-s\fR, \fB\-\-no\-messages\fR
|
|
|
|
suppress error messages
|
|
|
|
.TP
|
2025-02-24 06:01:46 +01:00
|
|
|
\fB\-T\fR, \fB\-\-initial\-tab\fR
|
|
|
|
make tabs line up (if needed)
|
|
|
|
.TP
|
|
|
|
\fB\-U\fR, \fB\-\-binary\fR
|
|
|
|
don't strip CR characters at EOL (DOS/Windows)
|
|
|
|
.TP
|
2025-02-24 05:01:08 +01:00
|
|
|
\fB\-v\fR, \fB\-\-invert\-match\fR
|
|
|
|
select non\-matching lines
|
|
|
|
.TP
|
|
|
|
\fB\-\-verbose\fR
|
|
|
|
verbose mode (show error messages)
|
|
|
|
.TP
|
|
|
|
\fB\-w\fR, \fB\-\-word\-regexp\fR
|
|
|
|
match only whole words
|
|
|
|
.TP
|
|
|
|
\fB\-x\fR, \fB\-\-line\-regexp\fR
|
|
|
|
match only whole lines
|
2025-02-24 05:43:00 +01:00
|
|
|
.TP
|
2025-02-24 06:01:46 +01:00
|
|
|
\fB\-Z\fR, \fB\-\-null\fR
|
|
|
|
print 0 byte (ASCII NUL) after file name
|
|
|
|
.TP
|
2025-02-24 05:43:00 +01:00
|
|
|
\fB\-\-bz2=\fR<command>
|
|
|
|
set compressor and options for bzip2 format
|
|
|
|
.TP
|
|
|
|
\fB\-\-gz=\fR<command>
|
|
|
|
set compressor and options for gzip format
|
|
|
|
.TP
|
|
|
|
\fB\-\-lz=\fR<command>
|
|
|
|
set compressor and options for lzip format
|
|
|
|
.TP
|
|
|
|
\fB\-\-xz=\fR<command>
|
|
|
|
set compressor and options for xz format
|
2025-02-24 06:00:49 +01:00
|
|
|
.TP
|
|
|
|
\fB\-\-zst=\fR<command>
|
|
|
|
set compressor and options for zstd format
|
2025-02-24 05:52:24 +01:00
|
|
|
.PP
|
2025-02-24 06:02:19 +01:00
|
|
|
Valid formats for options '\-M' and '\-O' are 'bz2', 'gz', 'lz', 'xz', 'zst',
|
|
|
|
and 'un' for uncompressed.
|
|
|
|
.PP
|
2025-02-24 05:52:24 +01:00
|
|
|
Numbers may be followed by a multiplier: k = kB = 10^3 = 1000,
|
|
|
|
Ki = KiB = 2^10 = 1024, M = 10^6, Mi = 2^20, G = 10^9, Gi = 2^30, etc...
|
2025-02-24 04:42:45 +01:00
|
|
|
.SH "REPORTING BUGS"
|
2025-02-24 04:44:01 +01:00
|
|
|
Report bugs to zutils\-bug@nongnu.org
|
2025-02-24 05:01:08 +01:00
|
|
|
.br
|
2025-02-24 04:44:01 +01:00
|
|
|
Zutils home page: http://www.nongnu.org/zutils/zutils.html
|
2025-02-24 04:42:45 +01:00
|
|
|
.SH COPYRIGHT
|
2025-02-24 06:05:15 +01:00
|
|
|
Copyright \(co 2025 Antonio Diaz Diaz.
|
2025-02-24 05:47:56 +01:00
|
|
|
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>
|
2025-02-24 05:01:08 +01:00
|
|
|
.br
|
|
|
|
This is free software: you are free to change and redistribute it.
|
|
|
|
There is NO WARRANTY, to the extent permitted by law.
|
2025-02-24 06:00:49 +01:00
|
|
|
.SH "SEE ALSO"
|
|
|
|
The full documentation for
|
|
|
|
.B zgrep
|
|
|
|
is maintained as a Texinfo manual. If the
|
|
|
|
.B info
|
|
|
|
and
|
|
|
|
.B zgrep
|
|
|
|
programs are properly installed at your site, the command
|
|
|
|
.IP
|
|
|
|
.B info zutils
|
|
|
|
.PP
|
|
|
|
should give you access to the complete manual.
|