aboutsummaryrefslogtreecommitdiff
path: root/src/scripts/xzgrep.1
blob: 63f012c946371d697081928d8f9e2e884dfcba19 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
.\" SPDX-License-Identifier: 0BSD
.\"
.\" Authors: Lasse Collin
.\"          Jia Tan
.\"
.\" (Note that this file is not based on gzip's zgrep.1.)
.\"
.TH XZGREP 1 "2024-02-13" "Tukaani" "XZ Utils"
.SH NAME
xzgrep \- search possibly-compressed files for patterns
.
.SH SYNOPSIS
.B xzgrep
.RI [ option... ]
.RI [ pattern_list ]
.RI [ file... ]
.br
.B xzegrep
\&...
.br
.B xzfgrep
\&...
.br
.B lzgrep
\&...
.br
.B lzegrep
\&...
.br
.B lzfgrep
\&...
.
.SH DESCRIPTION
.B xzgrep
invokes
.BR grep (1)
on uncompressed contents of files.
The formats of the
.I files
are determined from the filename suffixes.
Any
.I file
with a suffix supported by
.BR xz (1),
.BR gzip (1),
.BR bzip2 (1),
.BR lzop (1),
.BR zstd (1),
or
.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
.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
.B xzegrep
is an alias for
.BR "xzgrep \-E" .
.B xzfgrep
is an alias for
.BR "xzgrep \-F" .
.PP
The commands
.BR lzgrep ,
.BR lzegrep ,
and
.B lzfgrep
are provided for backward compatibility with LZMA Utils.
.
.SH EXIT STATUS
.TP
0
At least one match was found from at least one of the input files.
No errors occurred.
.TP
1
No matches were found from any of the input files.
No errors occurred.
.TP
>1
One or more errors occurred.
It is unknown if matches were found.
.
.SH ENVIRONMENT
.TP
.B GREP
If
.B GREP
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),
.BR gzip (1),
.BR bzip2 (1),
.BR lzop (1),
.BR zstd (1),
.BR lz4 (1),
.BR zgrep (1)