1 .\" $NetBSD: gzip.1,v 1.31 2018/10/26 22:10:15 christos Exp $
3 .\" Copyright (c) 1997, 2003, 2004, 2008, 2009, 2015, 2017 Matthew R. Green
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
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.
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
35 .Nd compression/decompression tool using Lempel-Ziv coding (LZ77)
63 program compresses and decompresses files using Lempel-Ziv coding
69 will compress from standard input, or decompress to standard output.
70 When in compression mode, each
72 will be replaced with another file with the suffix, set by the
74 option, added, if possible.
76 In decompression mode, each
78 will be checked for existence, as will the file with the suffix
82 argument must contain a separate complete archive;
85 are indicated, each is decompressed in turn.
89 the resulting data is then concatenated in the manner of
109 is also capable of decompressing files compressed using
117 The following options are available:
118 .Bl -tag -width XXrXXXrecursiveX
119 .It Fl 1 , Fl Fl fast
120 .It Fl 2 , 3 , 4 , 5 , 6 , 7 , 8
121 .It Fl 9 , Fl Fl best
122 These options change the compression level used, with the
124 option being the fastest, with less compression, and the
126 option being the slowest, with optimal compression.
127 The default compression level is 6.
128 .It Fl c , Fl Fl stdout , Fl Fl to-stdout
129 This option specifies that output will go to the standard output
130 stream, leaving files intact.
131 .It Fl d , Fl Fl decompress , Fl Fl uncompress
132 This option selects decompression rather than compression.
133 .It Fl f , Fl Fl force
134 This option turns on force mode.
135 This allows files with multiple links, symbolic links to regular files,
136 overwriting of pre-existing files, reading from or writing to a terminal,
137 and when combined with the
139 option, allowing non-compressed data to pass through unchanged.
140 .It Fl h , Fl Fl help
141 This option prints a usage summary and exits.
142 .It Fl k , Fl Fl keep
145 from deleting input files after (de)compression.
150 .It Fl l , Fl Fl list
151 This option displays information about the file's compressed and
152 uncompressed size, ratio, uncompressed name.
155 option, it also displays the compression method, CRC, date and time
156 embedded in the file.
157 .It Fl N , Fl Fl name
158 This option causes the stored filename in the input file to be used
160 .It Fl n , Fl Fl no-name
161 This option stops the filename and timestamp from being stored in
163 .It Fl q , Fl Fl quiet
164 With this option, no warnings or errors are printed.
165 .It Fl r , Fl Fl recursive
166 This option is used to
168 the files in a directory tree individually, using the
171 .It Fl S Ar suffix , Fl Fl suffix Ar suffix
172 This option changes the default suffix from .gz to
174 .It Fl t , Fl Fl test
175 This option will test compressed files for integrity.
176 .It Fl V , Fl Fl version
177 This option prints the version of the
180 .It Fl v , Fl Fl verbose
181 This option turns on verbose mode, which prints the compression
182 ratio for each file compressed.
185 If the environment variable
187 is set, it is parsed as a white-space separated list of options
188 handled before any options on the command line.
189 Options on the command line will override anything in
194 utility exits 0 on success,
196 and 2 if a warning occurs.
199 responds to the following signals:
200 .Bl -tag -width indent
202 Report progress to standard error.
214 program was originally written by Jean-loup Gailly, licensed under
215 the GNU Public Licence.
216 Matthew R. Green wrote a simple front end for
218 distribution media, based on the freely re-distributable zlib library.
219 It was enhanced to be mostly feature-compatible with the original
225 This implementation of
227 was ported based on the
231 and first appeared in
235 This implementation of
238 .An Matthew R. Green Aq Mt mrg@eterna.com.au
239 with unpack support written by
240 .An Xin LI Aq Mt delphij@FreeBSD.org .
242 According to RFC 1952, the recorded file size is stored in a 32-bit
243 integer, therefore, it cannot represent files larger than 4GB.
244 This limitation also applies to