summaryrefslogtreecommitdiffstats
path: root/src/scripts/xzgrep.1
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/scripts/xzgrep.1119
1 files changed, 75 insertions, 44 deletions
diff --git a/src/scripts/xzgrep.1 b/src/scripts/xzgrep.1
index e0514b8..63f012c 100644
--- a/src/scripts/xzgrep.1
+++ b/src/scripts/xzgrep.1
@@ -1,19 +1,18 @@
+.\" SPDX-License-Identifier: 0BSD
.\"
-.\" Original zgrep.1 for gzip: Jean-loup Gailly
-.\" Charles Levert <charles@comm.polymtl.ca>
+.\" Authors: Lasse Collin
+.\" Jia Tan
.\"
-.\" Modifications for XZ Utils: Lasse Collin
+.\" (Note that this file is not based on gzip's zgrep.1.)
.\"
-.\" License: GNU GPLv2+
-.\"
-.TH XZGREP 1 "2022-07-19" "Tukaani" "XZ Utils"
+.TH XZGREP 1 "2024-02-13" "Tukaani" "XZ Utils"
.SH NAME
-xzgrep \- search compressed files for a regular expression
+xzgrep \- search possibly-compressed files for patterns
+.
.SH SYNOPSIS
.B xzgrep
-.RI [ grep_options ]
-.RB [ \-e ]
-.I pattern
+.RI [ option... ]
+.RI [ pattern_list ]
.RI [ file... ]
.br
.B xzegrep
@@ -30,54 +29,84 @@ xzgrep \- search compressed files for a regular expression
.br
.B lzfgrep
\&...
+.
.SH DESCRIPTION
.B xzgrep
invokes
.BR grep (1)
-on
+on uncompressed contents of files.
+The formats of the
.I files
-which may be either uncompressed or compressed with
+are determined from the filename suffixes.
+Any
+.I file
+with a suffix supported by
.BR xz (1),
-.BR lzma (1),
.BR gzip (1),
.BR bzip2 (1),
.BR lzop (1),
+.BR zstd (1),
or
-.BR zstd (1).
-All options specified are passed directly to
-.BR grep (1).
+.BR lz4 (1)
+will be decompressed;
+all other files are assumed to be uncompressed.
.PP
If no
+.I files
+are specified or
.I file
-is specified, then standard input is decompressed if necessary
-and fed to
-.BR grep (1).
-When reading from standard input,
-.BR gzip (1),
-.BR bzip2 (1),
-.BR lzop (1),
-and
-.BR zstd (1)
-compressed files are not supported.
+is
+.B \-
+then standard input is read.
+When reading from standard input, only files supported by
+.BR xz (1)
+are decompressed.
+Other files are assumed to be in uncompressed form already.
+.PP
+Most
+.I options
+of
+.BR grep (1)
+are supported.
+However, the following options are not supported:
+.IP "" 4
+.BR \-r ,
+.B \-\-recursive
+.IP "" 4
+.BR \-R ,
+.B \-\-dereference\-recursive
+.IP "" 4
+.BR \-d ,
+.BI \-\-directories= action
+.IP "" 4
+.BR \-Z ,
+.B \-\-null
+.IP "" 4
+.BR \-z ,
+.B \-\-null\-data
+.IP "" 4
+.BI \-\-include= glob
+.IP "" 4
+.BI \-\-exclude= glob
+.IP "" 4
+.BI \-\-exclude\-from= file
+.IP "" 4
+.BI \-\-exclude\-dir= glob
.PP
-If
-.B xzgrep
-is invoked as
.B xzegrep
-or
+is an alias for
+.BR "xzgrep \-E" .
.B xzfgrep
-then
-.B grep \-E
-or
-.B grep \-F
-is used instead of
-.BR grep (1).
-The same applies to names
+is an alias for
+.BR "xzgrep \-F" .
+.PP
+The commands
.BR lzgrep ,
.BR lzegrep ,
and
-.BR lzfgrep ,
-which are provided for backward compatibility with LZMA Utils.
+.B lzfgrep
+are provided for backward compatibility with LZMA Utils.
+.
.SH EXIT STATUS
.TP
0
@@ -91,18 +120,19 @@ No errors occurred.
>1
One or more errors occurred.
It is unknown if matches were found.
+.
.SH ENVIRONMENT
.TP
.B GREP
-If the
+If
.B GREP
-environment variable is set,
-.B xzgrep
-uses it instead of
-.BR grep (1),
+is set to a non-empty value,
+it is used instead of
+.BR "grep" ,
.BR "grep \-E" ,
or
.BR "grep \-F" .
+.
.SH "SEE ALSO"
.BR grep (1),
.BR xz (1),
@@ -110,4 +140,5 @@ or
.BR bzip2 (1),
.BR lzop (1),
.BR zstd (1),
+.BR lz4 (1),
.BR zgrep (1)