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