Merge branch 'vendor/AWK'
[dragonfly.git] / usr.bin / gzip / gzip.1
1 .\"     $NetBSD: gzip.1,v 1.20 2009/04/01 08:15:37 mrg Exp $
2 .\"     $DragonFly: src/usr.bin/gzip/gzip.1,v 1.2 2007/12/06 19:54:52 hasso Exp $
3 .\"
4 .\" Copyright (c) 1997, 2003, 2004 Matthew R. Green
5 .\" All rights reserved.
6 .\"
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
9 .\" are met:
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\"    notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in the
14 .\"    documentation and/or other materials provided with the distribution.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .Dd July 28, 2009
29 .Dt GZIP 1
30 .Os
31 .Sh NAME
32 .Nm gzip
33 .Nd compression/decompression tool using Lempel-Ziv coding (LZ77)
34 .Sh SYNOPSIS
35 .Nm
36 .Op Fl cdfhklNnqrtVv
37 .Op Fl S Ar suffix
38 .Ar file
39 .Oo
40 .Ar file Oo ...
41 .Oc
42 .Oc
43 .Nm gunzip
44 .Op Fl cfhkNqrtVv
45 .Op Fl S Ar suffix
46 .Ar file
47 .Oo
48 .Ar file Oo ...
49 .Oc
50 .Oc
51 .Nm zcat
52 .Op Fl fhV
53 .Ar file
54 .Oo
55 .Ar file Oo ...
56 .Oc
57 .Oc
58 .Sh DESCRIPTION
59 The
60 .Nm
61 program compresses and decompresses files using Lempel-Ziv coding
62 (LZ77).
63 If no
64 .Ar files
65 are specified,
66 .Nm
67 will compress from standard input, or decompress to standard output.
68 When in compression mode, each
69 .Ar file
70 will be replaced with another file with the suffix, set by the
71 .Fl S Ar suffix
72 option, added, if possible.
73 In decompression mode, each
74 .Ar file
75 will be checked for existence, as will the file with the suffix
76 added.
77 .Pp
78 If invoked as
79 .Nm gunzip
80 then the
81 .Fl d
82 option is enabled.
83 If invoked as
84 .Nm zcat
85 or
86 .Nm gzcat
87 then both the
88 .Fl c
89 and
90 .Fl d
91 options are enabled.
92 .Pp
93 This version of
94 .Nm
95 is also capable of decompressing files compressed using
96 .Xr pack 1 ,
97 .Xr compress 1
98 or
99 .Xr bzip2 1 .
100 .Sh OPTIONS
101 The following options are available:
102 .Bl -tag -width XXrXXXrecursiveX
103 .It Fl 1 , -fast
104 .It Fl 2
105 .It Fl 3
106 .It Fl 4
107 .It Fl 5
108 .It Fl 6
109 .It Fl 7
110 .It Fl 8
111 .It Fl 9 , -best
112 These options change the compression level used, with the
113 .Fl 1
114 option being the fastest, with less compression, and the
115 .Fl 9
116 option being the slowest, with optimal compression.
117 The default compression level is 6.
118 .It Fl c , -stdout , -to-stdout
119 This option specifies that output will go to the standard output
120 stream, leaving files intact.
121 .It Fl d , -decompress , -uncompress
122 This option selects decompression rather than compression.
123 .It Fl f , -force
124 This option turns on force mode.
125 This allows files with multiple links, overwriting of pre-existing
126 files, reading from or writing to a terminal, and when combined
127 with the
128 .Fl c
129 option, allowing non-compressed data to pass through unchanged.
130 .It Fl h , -help
131 This option prints a usage summary and exits.
132 .It Fl k , -keep
133 Keep (don't delete) input files during compression
134 or decompression.
135 .It Fl l , -list
136 This option displays information about the file's compressed and
137 uncompressed size, ratio, uncompressed name.
138 With the
139 .Fl v
140 option, it also displays the compression method, CRC, date and time
141 embedded in the file.
142 .It Fl N , -name
143 This option causes the stored filename in the input file to be used
144 as the output file.
145 .It Fl n , -no-name
146 This option stops the filename and timestamp from being stored in
147 the output file.
148 .It Fl q , -quiet
149 With this option, no warnings or errors are printed.
150 .It Fl r , -recursive
151 This option is used to
152 .Nm
153 the files in a directory tree individually, using the
154 .Xr fts 3
155 library.
156 .It Fl S Ar suffix , Fl -suffix Ar suffix
157 This option changes the default suffix from .gz to
158 .Ar suffix .
159 .It Fl t , -test
160 This option will test compressed files for integrity.
161 .It Fl V , -version
162 This option prints the version of the
163 .Nm
164 program.
165 .It Fl v , -verbose
166 This option turns on verbose mode, which prints the compression
167 ratio for each file compressed.
168 .El
169 .Sh ENVIRONMENT
170 If the environment variable
171 .Ev GZIP
172 is set, it is parsed as a white-space separated list of options
173 handled before any options on the command line.
174 Options on the command line will override anything in
175 .Ev GZIP .
176 .Sh SEE ALSO
177 .Xr bzip2 1 ,
178 .Xr compress 1 ,
179 .Xr fts 3 ,
180 .Xr zlib 3
181 .Sh HISTORY
182 The
183 .Nm
184 program was originally written by Jean-loup Gailly, licensed under
185 the GNU Public Licence.
186 Matthew R. Green wrote a simple front end for
187 .Nx 1.3
188 distribution media, based on the freely re-distributable zlib library.
189 It was enhanced to be mostly feature-compatible with the original
190 GNU
191 .Nm
192 program for
193 .Nx 2.0 .
194 .Pp
195 This manual documents
196 .Nx
197 .Nm
198 version 20040427.
199 .Sh AUTHORS
200 This implementation of
201 .Nm
202 was written by
203 .An Matthew R. Green Aq mrg@eterna.com.au .