summaryrefslogtreecommitdiffstats
path: root/src/scripts/xzgrep.1
blob: e0514b8b8353309b8c1ffb4316b886c00037b2cc (plain)
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
.\"
.\" Original zgrep.1 for gzip: Jean-loup Gailly
.\"                            Charles Levert <charles@comm.polymtl.ca>
.\"
.\" Modifications for XZ Utils: Lasse Collin
.\"
.\" License: GNU GPLv2+
.\"
.TH XZGREP 1 "2022-07-19" "Tukaani" "XZ Utils"
.SH NAME
xzgrep \- search compressed files for a regular expression
.SH SYNOPSIS
.B xzgrep
.RI [ grep_options ]
.RB [ \-e ]
.I pattern
.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
.I files
which may be either uncompressed or compressed with
.BR xz (1),
.BR lzma (1),
.BR gzip (1),
.BR bzip2 (1),
.BR lzop (1),
or
.BR zstd (1).
All options specified are passed directly to
.BR grep (1).
.PP
If no
.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.
.PP
If
.B xzgrep
is invoked as
.B xzegrep
or
.B xzfgrep
then
.B grep \-E
or
.B grep \-F
is used instead of
.BR grep (1).
The same applies to names
.BR lzgrep ,
.BR lzegrep ,
and
.BR lzfgrep ,
which 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 the
.B GREP
environment variable is set,
.B xzgrep
uses it instead of
.BR grep (1),
.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 zgrep (1)