]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/gzip/gzip.1
Sync with -HEAD:
[FreeBSD/FreeBSD.git] / usr.bin / gzip / gzip.1
1 .\"     $NetBSD: gzip.1,v 1.18 2005/09/30 13:46:56 wiz Exp $
2 .\"
3 .\" Copyright (c) 1997, 2003, 2004 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 .\" 3. The name of the author may not be used to endorse or promote products
15 .\"    derived from this software without specific prior written permission.
16 .\"
17 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22 .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24 .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 .\" SUCH DAMAGE.
28 .\"
29 .\" $FreeBSD$
30 .Dd June 30, 2008
31 .Dt GZIP 1
32 .Os
33 .Sh NAME
34 .Nm gzip
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 or
112 .Xr bzip2 1 .
113 .Sh OPTIONS
114 The following options are available:
115 .Bl -tag -width XXrXXXrecursiveX
116 .It Fl 1 , -fast
117 .It Fl 2 , 3 , 4 , 5 , 6 , 7 , 8
118 .It Fl 9 , -best
119 These options change the compression level used, with the
120 .Fl 1
121 option being the fastest, with less compression, and the
122 .Fl 9
123 option being the slowest, with optimal compression.
124 The default compression level is 6.
125 .It Fl c , -stdout , -to-stdout
126 This option specifies that output will go to the standard output
127 stream, leaving files intact.
128 .It Fl d , -decompress , -uncompress
129 This option selects decompression rather than compression.
130 .It Fl f , -force
131 This option turns on force mode.
132 This allows files with multiple links, overwriting of pre-existing
133 files, reading from or writing to a terminal, and when combined
134 with the
135 .Fl c
136 option, allowing non-compressed data to pass through unchanged.
137 .It Fl h , -help
138 This option prints a usage summary and exits.
139 .It Fl k , -keep
140 Keep (don't delete) input files during compression
141 or decompression.
142 .It Fl L , -license
143 This option prints
144 .Nm
145 license.
146 .It Fl l , -list
147 This option displays information about the file's compressed and
148 uncompressed size, ratio, uncompressed name.
149 With the
150 .Fl v
151 option, it also displays the compression method, CRC, date and time
152 embedded in the file.
153 .It Fl N , -name
154 This option causes the stored filename in the input file to be used
155 as the output file.
156 .It Fl n , -no-name
157 This option stops the filename from being stored in the output
158 file.
159 .It Fl q , -quiet
160 With this option, no warnings or errors are printed.
161 .It Fl r , -recursive
162 This option is used to
163 .Nm
164 the files in a directory tree individually, using the
165 .Xr fts 3
166 library.
167 .It Fl S Ar suffix , Fl -suffix Ar suffix
168 This option changes the default suffix from .gz to
169 .Ar suffix .
170 .It Fl t , -test
171 This option will test compressed files for integrity.
172 .It Fl V , -version
173 This option prints the version of the
174 .Nm
175 program.
176 .It Fl v , -verbose
177 This option turns on verbose mode, which prints the compression
178 ratio for each file compressed.
179 .El
180 .Sh ENVIRONMENT
181 If the environment variable
182 .Ev GZIP
183 is set, it is parsed as a white-space separated list of options
184 handled before any options on the command line.
185 Options on the command line will override anything in
186 .Ev GZIP .
187 .Sh SEE ALSO
188 .Xr bzip2 1 ,
189 .Xr compress 1 ,
190 .Xr fts 3 ,
191 .Xr zlib 3
192 .Sh HISTORY
193 The
194 .Nm
195 program was originally written by Jean-loup Gailly, licensed under
196 the GNU Public Licence.
197 Matthew R. Green wrote a simple front end for
198 .Nx 1.3
199 distribution media, based on the freely re-distributable zlib library.
200 It was enhanced to be mostly feature-compatible with the original
201 GNU
202 .Nm
203 program for
204 .Nx 2.0 .
205 .Pp
206 This implementation of
207 .Nm
208 was ported based on the
209 .Nx
210 .Nm
211 20060927, and first appeared in
212 .Fx 7.0 .
213 .Sh AUTHORS
214 This implementation of
215 .Nm
216 was written by
217 .An Matthew R. Green Aq mrg@eterna.com.au .
218 .Sh BUGS
219 According to RFC 1952, the recorded file size is stored in a 32-bit
220 integer and therefore it can not represent files that is bigger than
221 4GB in size.  This limitation also applies to
222 .Fl l
223 option of
224 .Nm
225 utility.