|
|
1.1 root 1: .PU
2: .TH GZIP 1 local
3: .SH NAME
4: gzip, gunzip, zcat \- compress or expand files
5: .SH SYNOPSIS
6: .ll +8
7: .B gzip
8: .RB [ " \-cdfhLrtvV19 " ]
9: [
10: .I "name \&..."
11: ]
12: .ll -8
13: .br
14: .B gunzip
15: .RB [ " \-cfhLrtvV " ]
16: [
17: .I "name \&..."
18: ]
19: .br
20: .B zcat
21: .RB [ " \-hLV " ]
22: [
23: .I "name \&..."
24: ]
25: .SH DESCRIPTION
26: .I Gzip
27: reduces the size of the named files using Lempel-Ziv coding (LZ77).
28: Whenever possible,
29: each file is replaced by one with the extension
30: .B "\&.z,"
31: while keeping the same ownership modes, access and modification times.
32: (The extension is
33: .B "\-z"
34: for VMS,
35: .B "z"
36: for MSDOS, OS/2 and Atari.)
37: If no files are specified, the standard input is compressed to the
38: standard output. If the new file name is too long,
39: .I gzip
40: truncates it and keeps the original file name in the compressed file.
41: .I Gzip
42: will only attempt to compress regular files.
43: In particular, it will ignore symbolic links.
44: .PP
45: Compressed files can be restored to their original form using
46: .I gzip -d
47: or
48: .I gunzip
49: or
50: .I zcat.
51: .PP
52: .I gunzip
53: takes a list of files on its command line and replaces each
54: file whose name ends with
55: .B "\&.z"
56: or
57: .B "\&.Z"
58: or
59: .B "\&-z"
60: and which begins with the correct magic number with an uncompressed
61: file without the original extension.
62: .I gunzip
63: also recognizes the special extensions
64: .B "\&.tgz"
65: and
66: .B "\&.taz"
67: as shorthands for
68: .B "\&.tar.z"
69: or
70: .B "\&.tar.Z"
71: .PP
72: .I gunzip
73: can currently decompress files created by
74: .I gzip, zip, compress
75: or
76: .I pack.
77: The detection of the input format is automatic. When using
78: the first two formats,
79: .I gunzip
80: checks a 32 bit CRC. For
81: .I pack, gunzip
82: checks the uncompressed length. The
83: .I compress
84: format was not designed to allow consistency checks. However
85: .I gunzip
86: is sometimes able to detect a bad .Z file. If you get an error
87: when uncompressing a .Z file, do not assume that the .Z file is
88: correct simply because the standard
89: .I uncompress
90: does not complain. This generally means that the standard
91: .I uncompress
92: does not check its input, and happily generates garbage output.
93: .PP
94: Files created by
95: .I zip
96: can be uncompressed by gzip only if they have a single member compressed
97: with the 'deflation' method. This feature is only intended to help
98: conversion of tar.zip files to the tar.z format. To extract zip files
99: with several members, use
100: .I unzip
101: instead of
102: .I gunzip.
103: .PP
104: .I zcat
105: is identical to
106: .I gunzip
107: .B \-c.
108: (On some systems,
109: .I zcat
110: may be installed as
111: .I gzcat
112: to preserve the original link to
113: .I compress.)
114: .I zcat
115: uncompresses either a list of files on the command line or its
116: standard input and writes the uncompressed data on standard output.
117: .I zcat
118: will uncompress files that have the correct magic number whether
119: they have a
120: .B "\&.z"
121: suffix or not.
122: .PP
123: .I Gzip
124: uses the Lempel-Ziv algorithm used in
125: .I zip
126: and PKZIP.
127: The amount of compression obtained depends on the size of the
128: input and the distribution of common substrings.
129: Typically, text such as source code or English
130: is reduced by 60\-70%.
131: Compression is generally much better than that achieved by
132: LZW (as used in
133: .IR compress ),
134: Huffman coding (as used in
135: .IR pack ),
136: or adaptive Huffman coding
137: .RI ( compact ).
138: .PP
139: Compression is always performed, even if the compressed file is
140: slightly larger than the original. The worst case expansion is
141: a few bytes for the gzip file header, plus 5 bytes every 32K block,
142: or an expansion ratio of 0.015% for large files.
143: .I gzip
144: preserves the mode, ownership and timestamps of files when compressing
145: or decompressing.
146:
147: .SH OPTIONS
148: .TP
149: .B \-c --stdout
150: Write output on standard output; keep original files unchanged.
151: If there are several input files, the output consists of a sequence of
152: independently compressed members. To obtain better compression,
153: concatenate all input files before compressing them.
154: .TP
155: .B \-d --decompress
156: Decompress.
157: .TP
158: .B \-f --force
159: Force compression or decompression even if the file has multiple links
160: or the corresponding file already exists.
161: If
162: .B \-f
163: is not given,
164: and when not running in the background,
165: .I gzip
166: prompts to verify whether an existing file should be overwritten.
167: .TP
168: .B \-h --help
169: Display a help screen.
170: .TP
171: .B \-L --license
172: Display the
173: .I gzip
174: license.
175: .TP
176: .B \-q --quiet
177: Suppress all warnings.
178: .TP
179: .B \-r --recurse
180: Travel the directory structure recursively. If any of the file names
181: specified on the command line are directories,
182: .I gzip
183: will descend into the directory and compress all the files it finds there
184: (or decompress them in the case of
185: .I gunzip
186: ).
187: .TP
188: .B \-t --test
189: Test. Check the compressed file integrity.
190: .TP
191: .B \-v --verbose
192: Verbose. Display the name and percentage reduction for each file compressed.
193: .TP
194: .B \-V --version
195: Version. Display the version number and compilation options.
196: .TP
197: .B \-# --fast --best
198: Regulate the speed of compression using the specified digit
199: .IR # ,
200: where
201: .B \-1
202: or
203: .B \-\-fast
204: indicates the fastest compression method (less compression)
205: and
206: .B \-9
207: or
208: .B \-\-best
209: indicates the slowest compression method (optimal compression).
210: The default compression level is
211: .BR \-5.
212: .SH "ADVANCED USAGE"
213: Multiple compressed files can be concatenated. In this case,
214: .I gunzip
215: will extract all members at once. For example:
216:
217: gzip -c file1 > foo.z
218: gzip -c file2 >> foo.z
219: Then
220: gunzip -c foo
221:
222: is equivalent to
223:
224: cat file1 file2
225:
226: In case of damage to one member of a .z file, other members can
227: still be recovered (if the damaged member is removed). However,
228: you can get better compression by compressing all members at once:
229:
230: cat file1 file2 | gzip > foo.z
231:
232: compresses better than
233:
234: gzip -c file1 file2 > foo.z
235:
236: If you want to recompress concatenated files to get better compression, do:
237:
238: zcat old.z | gzip > new.z
239: .SH "ENVIRONMENT"
240: The environment variable
241: .B GZIP
242: can hold a set of default options for
243: .I gzip.
244: These options are interpreted first and can be ovewritten by
245: explicit command line parameters. For example:
246: for sh: GZIP="-8 -v"; export GZIP
247: for csh: setenv GZIP "-8 -v"
248: for MSDOS: set GZIP=-8 -v
249:
250: On Vax/VMS, the name of the environment variable is GZIP_OPT, to
251: avoid a conflict with the symbol set for invocation of the program.
252: .SH "SEE ALSO"
253: znew(1), zcmp(1), zmore(1), zforce(1), gzexe(1), zip(1), unzip(1), compress(1),
254: pack(1), compact(1)
255: .SH "DIAGNOSTICS"
256: Exit status is normally 0;
257: if an error occurs, exit status is 1. If a warning occurs, exit status is 2.
258: .PP
259: Usage: gzip [-cdfhLrtvV19] [file ...]
260: .in +8
261: Invalid options were specified on the command line.
262: .in -8
263: .IR file :
264: not in gzip format
265: .in +8
266: The file specified to
267: .I gunzip
268: has not been compressed.
269: .in -8
270: .IR file:
271: Corrupt input. Use zcat to recover some data.
272: .in +8
273: The compressed file has been damaged. The data up to the point of failure
274: can be recovered using
275: .in +8
276: zcat file > recover
277: .in -16
278: .IR file :
279: compressed with
280: .I xx
281: bits, can only handle
282: .I yy
283: bits
284: .in +8
285: .I File
286: was compressed (using LZW) by a program that could deal with
287: more
288: .I bits
289: than the decompress code on this machine.
290: Recompress the file with gzip, which compresses better and uses
291: less memory.
292: .in -8
293: .IR file :
294: already has z suffix -- no change
295: .in +8
296: The file is assumed to be already compressed.
297: Rename the file and try again or use zcat.
298: .in -8
299: .I file
300: already exists; do you wish to overwrite (y or n)?
301: .in +8
302: Respond "y" if you want the output file to be replaced; "n" if not.
303: .in -8
304: gunzip: corrupt input
305: .in +8
306: A SIGSEGV violation was detected which usually means that the input file has
307: been corrupted.
308: .in -8
309: .I "xx.x%"
310: .in +8
311: Percentage of the input saved by compression.
312: (Relevant only for
313: .BR \-v \.)
314: .in -8
315: -- not a regular file or directory: ignored
316: .in +8
317: When the input file is not a regular file or directory,
318: (e.g. a symbolic link, socket, FIFO, device file), it is
319: left unaltered.
320: .in -8
321: -- has
322: .I xx
323: other links: unchanged
324: .in +8
325: The input file has links; it is left unchanged. See
326: .IR ln "(1)"
327: for more information. Use the
328: .B \-f
329: flag to force compression of multiply-linked files.
330: .in -8
331: .SH CAVEATS
332: The .z extension is already used by
333: .IR pack "(1)".
334: You can link
335: .I gzip
336: to
337: .I pcat
338: to get transparent decompression for programs expecting .z files to be in
339: .IR pack
340: format.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.