1.\" $NetBSD: gzip.1,v 1.17 2004/04/27 11:26:28 mrg 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.Dd April 27, 2004 30.Dt GZIP 1 31.Os 32.Sh NAME 33.Nm gzip 34.Nd compression/decompression tool using Lempel-Ziv coding (LZ77) 35.Sh SYNOPSIS 36.Nm 37.Op Fl cdfhlNnqrtVv 38.Op Fl S Ar suffix 39.Ar file 40.Oo 41.Ar file Oo ... 42.Oc 43.Oc 44.Nm gunzip 45.Op Fl cfhNqrtVv 46.Op Fl S Ar suffix 47.Ar file 48.Oo 49.Ar file Oo ... 50.Oc 51.Oc 52.Nm zcat 53.Op Fl fhV 54.Ar file 55.Oo 56.Ar file Oo ... 57.Oc 58.Oc 59.Sh DESCRIPTION 60The 61.Nm 62program compresses and decompresses files using Lempel-Ziv coding 63(LZ77). 64If no 65.Ar files 66are specified, 67.Nm 68will compress from standard input, or decompress to standard output. 69When in compression mode, each 70.Ar file 71will be replaced with another file with the suffix, set by the 72.Fl S Ar suffix 73option, added, if possible. 74In decompression mode, each 75.Ar file 76will be checked for existence, as will the file with the suffix 77added. 78.Pp 79If invoked as 80.Nm gunzip 81then the 82.Fl d 83option is enabled. 84If invoked as 85.Nm zcat 86or 87.Nm gzcat 88then both the 89.Fl c 90and 91.Fl d 92options are enabled. 93.Pp 94This version of 95.Nm 96is also capable of decompressing files compressed using 97.Xr compress 1 98or 99.Xr bzip2 1 . 100.Sh OPTIONS 101The 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 112These options change the compression level used, with the 113.Fl 1 114option being the fastest, with less compression, and the 115.Fl 9 116option being the slowest, with optimal compression. 117The default compression level is 6. 118.It Fl c , -stdout , -to-stdout 119This option specifies that output will go to the standard output 120stream, leaving files intact. 121.It Fl d , -decompress , -uncompress 122This option selects decompression rather than compression. 123.It Fl f , -force 124This option turns on force mode. 125This allows files with multiple links, overwriting of pre-existing 126files, reading from or writing to a terminal, and when combined 127with the 128.Fl c 129option, allowing non-compressed data to pass through unchanged. 130.It Fl h , -help 131This option prints a usage summary and exits. 132.It Fl l , -list 133This option displays information about the file's compressed and 134uncompressed size, ratio, uncompressed name. 135With the 136.Fl v 137option, it also displays the compression method, CRC, data and time 138embedded in the file. 139.It Fl N , -name 140This option causes the stored filename in the input file to be used 141as the output file. 142.It Fl n , -no-name 143This option stops the filename from being stored in the output 144file. 145.It Fl q , -quiet 146With this option, no warnings or errors are printed. 147.It Fl r , -recursive 148This option is used to 149.Nm 150the files in a directory tree individually, using the 151.Xr fts 3 152library. 153.It Fl S Ar suffix , Fl -suffix Ar suffix 154This option changes the default suffix from .gz to 155.Ar suffix . 156.It Fl t , -test 157This option will test compressed files for integrity. 158.It Fl V , -version 159This option prints the version of the 160.Nm 161program. 162.It Fl v , -verbose 163This option turns on verbose mode, which prints the compression 164ratio for each file compressed. 165.El 166.Sh ENVIRONMENT 167If the environment variable 168.Ev GZIP 169is set, it is parsed as a white-space separated list of options 170handled before any options on the command line. 171Options on the command line will override anything in 172.Ev GZIP . 173.Sh SEE ALSO 174.Xr bzip2 1 , 175.Xr compress 1 , 176.Xr fts 3 , 177.Xr zlib 3 178.Sh HISTORY 179The 180.Nm 181program was originally written by Jean-loup Gailly, licensed under 182the GNU Public Licence. 183Matthew R. Green wrote a simple front end for 184.Nx 1.3 185distribution media, based on the freely re-distributable zlib library. 186It was enhanced to be mostly feature-compatible with the original 187GNU 188.Nm 189program for 190.Nx 2.0 . 191.Pp 192This manual documents 193.Nx 194.Nm 195version 20040427. 196.Sh AUTHORS 197This implementation of 198.Nm 199was written by 200.An Matthew R. Green Aq mrg@eterna.com.au . 201