xref: /freebsd/usr.bin/gzip/gzip.1 (revision 2b743a9e9ddc6736208dc8ca1ce06ce64ad20a19)
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 January 26, 2007
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 cdfhLlNnqrtVv
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 cfhLNqrtVv
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
61The
62.Nm
63program compresses and decompresses files using Lempel-Ziv coding
64(LZ77).
65If no
66.Ar files
67are specified,
68.Nm
69will compress from standard input, or decompress to standard output.
70When in compression mode, each
71.Ar file
72will be replaced with another file with the suffix, set by the
73.Fl S Ar suffix
74option, added, if possible.
75In decompression mode, each
76.Ar file
77will be checked for existence, as will the file with the suffix
78added.
79.Pp
80If invoked as
81.Nm gunzip
82then the
83.Fl d
84option is enabled.
85If invoked as
86.Nm zcat
87or
88.Nm gzcat
89then both the
90.Fl c
91and
92.Fl d
93options are enabled.
94.Pp
95This version of
96.Nm
97is also capable of decompressing files compressed using
98.Xr compress 1
99or
100.Xr bzip2 1 .
101.Sh OPTIONS
102The following options are available:
103.Bl -tag -width XXrXXXrecursiveX
104.It Fl 1 , -fast
105.It Fl 2 , 3 , 4 , 5 , 6 , 7 , 8
106.It Fl 9 , -best
107These options change the compression level used, with the
108.Fl 1
109option being the fastest, with less compression, and the
110.Fl 9
111option being the slowest, with optimal compression.
112The default compression level is 6.
113.It Fl c , -stdout , -to-stdout
114This option specifies that output will go to the standard output
115stream, leaving files intact.
116.It Fl d , -decompress , -uncompress
117This option selects decompression rather than compression.
118.It Fl f , -force
119This option turns on force mode.
120This allows files with multiple links, overwriting of pre-existing
121files, reading from or writing to a terminal, and when combined
122with the
123.Fl c
124option, allowing non-compressed data to pass through unchanged.
125.It Fl h , -help
126This option prints a usage summary and exits.
127.It Fl L , -license
128This option prints
129.Nm
130license.
131.It Fl l , -list
132This option displays information about the file's compressed and
133uncompressed size, ratio, uncompressed name.
134With the
135.Fl v
136option, it also displays the compression method, CRC, date and time
137embedded in the file.
138.It Fl N , -name
139This option causes the stored filename in the input file to be used
140as the output file.
141.It Fl n , -no-name
142This option stops the filename from being stored in the output
143file.
144.It Fl q , -quiet
145With this option, no warnings or errors are printed.
146.It Fl r , -recursive
147This option is used to
148.Nm
149the files in a directory tree individually, using the
150.Xr fts 3
151library.
152.It Fl S Ar suffix , Fl -suffix Ar suffix
153This option changes the default suffix from .gz to
154.Ar suffix .
155.It Fl t , -test
156This option will test compressed files for integrity.
157.It Fl V , -version
158This option prints the version of the
159.Nm
160program.
161.It Fl v , -verbose
162This option turns on verbose mode, which prints the compression
163ratio for each file compressed.
164.El
165.Sh ENVIRONMENT
166If the environment variable
167.Ev GZIP
168is set, it is parsed as a white-space separated list of options
169handled before any options on the command line.
170Options on the command line will override anything in
171.Ev GZIP .
172.Sh SEE ALSO
173.Xr bzip2 1 ,
174.Xr compress 1 ,
175.Xr fts 3 ,
176.Xr zlib 3
177.Sh HISTORY
178The
179.Nm
180program was originally written by Jean-loup Gailly, licensed under
181the GNU Public Licence.
182Matthew R. Green wrote a simple front end for
183.Nx 1.3
184distribution media, based on the freely re-distributable zlib library.
185It was enhanced to be mostly feature-compatible with the original
186GNU
187.Nm
188program for
189.Nx 2.0 .
190.Pp
191This implementation of
192.Nm
193was ported based on the
194.Nx
195.Nm
19620060927, and first appeared in
197.Fx 7.0 .
198.Sh AUTHORS
199This implementation of
200.Nm
201was written by
202.An Matthew R. Green Aq mrg@eterna.com.au .
203