]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/gzip/gzip.1
stand/powerpc: Only build loader.kboot for powerpc64
[FreeBSD/FreeBSD.git] / usr.bin / gzip / gzip.1
1 .\"     $NetBSD: gzip.1,v 1.31 2018/10/26 22:10:15 christos Exp $
2 .\"
3 .\" Copyright (c) 1997, 2003, 2004, 2008, 2009, 2015, 2017 Matthew R. Green
4 .\" All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\"
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20 .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
22 .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 .\" SUCH DAMAGE.
26 .\"
27 .\" $FreeBSD$
28 .Dd January 7, 2019
29 .Dt GZIP 1
30 .Os
31 .Sh NAME
32 .Nm gzip ,
33 .Nm gunzip ,
34 .Nm zcat
35 .Nd compression/decompression tool using Lempel-Ziv coding (LZ77)
36 .Sh SYNOPSIS
37 .Nm
38 .Op Fl cdfhkLlNnqrtVv
39 .Op Fl S Ar suffix
40 .Ar file
41 .Oo
42 .Ar file Oo ...
43 .Oc
44 .Oc
45 .Nm gunzip
46 .Op Fl cfhkLNqrtVv
47 .Op Fl S Ar suffix
48 .Ar file
49 .Oo
50 .Ar file Oo ...
51 .Oc
52 .Oc
53 .Nm zcat
54 .Op Fl fhV
55 .Ar file
56 .Oo
57 .Ar file Oo ...
58 .Oc
59 .Oc
60 .Sh DESCRIPTION
61 The
62 .Nm
63 program compresses and decompresses files using Lempel-Ziv coding
64 (LZ77).
65 If no
66 .Ar files
67 are specified,
68 .Nm
69 will compress from standard input, or decompress to standard output.
70 When in compression mode, each
71 .Ar file
72 will be replaced with another file with the suffix, set by the
73 .Fl S Ar suffix
74 option, added, if possible.
75 .Pp
76 In decompression mode, each
77 .Ar file
78 will be checked for existence, as will the file with the suffix
79 added.
80 Each
81 .Ar file
82 argument must contain a separate complete archive;
83 when multiple
84 .Ar files
85 are indicated, each is decompressed in turn.
86 .Pp
87 In the case of
88 .Nm gzcat
89 the resulting data is then concatenated in the manner of
90 .Xr cat 1 .
91 .Pp
92 If invoked as
93 .Nm gunzip
94 then the
95 .Fl d
96 option is enabled.
97 If invoked as
98 .Nm zcat
99 or
100 .Nm gzcat
101 then both the
102 .Fl c
103 and
104 .Fl d
105 options are enabled.
106 .Pp
107 This version of
108 .Nm
109 is also capable of decompressing files compressed using
110 .Xr compress 1 ,
111 .Xr bzip2 1 ,
112 .Ar lzip ,
113 or
114 .Xr xz 1 .
115 .Sh OPTIONS
116 The following options are available:
117 .Bl -tag -width XXrXXXrecursiveX
118 .It Fl 1 , Fl Fl fast
119 .It Fl 2 , 3 , 4 , 5 , 6 , 7 , 8
120 .It Fl 9 , Fl Fl best
121 These options change the compression level used, with the
122 .Fl 1
123 option being the fastest, with less compression, and the
124 .Fl 9
125 option being the slowest, with optimal compression.
126 The default compression level is 6.
127 .It Fl c , Fl Fl stdout , Fl Fl to-stdout
128 This option specifies that output will go to the standard output
129 stream, leaving files intact.
130 .It Fl d , Fl Fl decompress , Fl Fl uncompress
131 This option selects decompression rather than compression.
132 .It Fl f , Fl Fl force
133 This option turns on force mode.
134 This allows files with multiple links, symbolic links to regular files,
135 overwriting of pre-existing files, reading from or writing to a terminal,
136 and when combined with the
137 .Fl c
138 option, allowing non-compressed data to pass through unchanged.
139 .It Fl h , Fl Fl help
140 This option prints a usage summary and exits.
141 .It Fl k , Fl Fl keep
142 This option prevents
143 .Nm
144 from deleting input files after (de)compression.
145 .It Fl L , -license
146 This option prints
147 .Nm
148 license.
149 .It Fl l , Fl Fl list
150 This option displays information about the file's compressed and
151 uncompressed size, ratio, uncompressed name.
152 With the
153 .Fl v
154 option, it also displays the compression method, CRC, date and time
155 embedded in the file.
156 .It Fl N , Fl Fl name
157 This option causes the stored filename in the input file to be used
158 as the output file.
159 .It Fl n , Fl Fl no-name
160 This option stops the filename and timestamp from being stored in
161 the output file.
162 .It Fl q , Fl Fl quiet
163 With this option, no warnings or errors are printed.
164 .It Fl r , Fl Fl recursive
165 This option is used to
166 .Nm
167 the files in a directory tree individually, using the
168 .Xr fts 3
169 library.
170 .It Fl S Ar suffix , Fl Fl suffix Ar suffix
171 This option changes the default suffix from .gz to
172 .Ar suffix .
173 .It Fl t , Fl Fl test
174 This option will test compressed files for integrity.
175 .It Fl V , Fl Fl version
176 This option prints the version of the
177 .Nm
178 program.
179 .It Fl v , Fl Fl verbose
180 This option turns on verbose mode, which prints the compression
181 ratio for each file compressed.
182 .El
183 .Sh ENVIRONMENT
184 If the environment variable
185 .Ev GZIP
186 is set, it is parsed as a white-space separated list of options
187 handled before any options on the command line.
188 Options on the command line will override anything in
189 .Ev GZIP .
190 .Sh EXIT STATUS
191 The
192 .Nm
193 utility exits 0 on success,
194 1 on errors,
195 and 2 if a warning occurs.
196 .Sh SIGNALS
197 .Nm
198 responds to the following signals:
199 .Bl -tag -width indent
200 .It Dv SIGINFO
201 Report progress to standard error.
202 .El
203 .Sh SEE ALSO
204 .Xr bzip2 1 ,
205 .Xr compress 1 ,
206 .Xr xz 1 ,
207 .Xr fts 3 ,
208 .Xr zlib 3
209 .Sh HISTORY
210 The
211 .Nm
212 program was originally written by Jean-loup Gailly, licensed under
213 the GNU Public Licence.
214 Matthew R. Green wrote a simple front end for
215 .Nx 1.3
216 distribution media, based on the freely re-distributable zlib library.
217 It was enhanced to be mostly feature-compatible with the original
218 GNU
219 .Nm
220 program for
221 .Nx 2.0 .
222 .Pp
223 This implementation of
224 .Nm
225 was ported based on the
226 .Nx
227 .Nm
228 version 20181111,
229 and first appeared in
230 .Fx 7.0 .
231 .Sh AUTHORS
232 .An -nosplit
233 This implementation of
234 .Nm
235 was written by
236 .An Matthew R. Green Aq Mt mrg@eterna.com.au
237 with unpack support written by
238 .An Xin LI Aq Mt delphij@FreeBSD.org .
239 .Sh BUGS
240 According to RFC 1952, the recorded file size is stored in a 32-bit
241 integer, therefore, it cannot represent files larger than 4GB.
242 This limitation also applies to
243 .Fl l
244 option of
245 .Nm
246 utility.