|
|
1.1 root 1: \input texinfo @c -*-texinfo-*-
2: @c %**start of header
3: @setfilename gzip.info
4: @settitle Gzip User's Manual
5: @finalout
6: @setchapternewpage odd
7: @c %**end of header
8:
9: @ifinfo
10: This file documents the the GNU @code{gzip} command for compressing files.
11:
12: Copyright (C) 1992-1993 Jean-loup Gailly
13:
14: Permission is granted to make and distribute verbatim copies of
15: this manual provided the copyright notice and this permission notice
16: are preserved on all copies.
17:
18: @ignore
19: Permission is granted to process this file through TeX and print the
20: results, provided the printed document carries copying permission
21: notice identical to this one except for the removal of this paragraph
22: (this paragraph not being relevant to the printed manual).
23:
24: @end ignore
25: Permission is granted to copy and distribute modified versions of this
26: manual under the conditions for verbatim copying, provided that the entire
27: resulting derived work is distributed under the terms of a permission
28: notice identical to this one.
29:
30: Permission is granted to copy and distribute translations of this manual
31: into another language, under the above conditions for modified versions,
32: except that this permission notice may be stated in a translation approved
33: by the Foundation.
34: @end ifinfo
35:
36: @titlepage
37: @title gzip
38: @subtitle The data compression program
39: @subtitle Edition 1.0.5, for Gzip Version 1.0.5
40: @subtitle March 1993
41: @author by Jean-loup Gailly
42:
43: @page
44: @vskip 0pt plus 1filll
45: Copyright @copyright{} 1992-1993 Jean-loup Gailly
46:
47: Permission is granted to make and distribute verbatim copies of
48: this manual provided the copyright notice and this permission notice
49: are preserved on all copies.
50:
51: Permission is granted to copy and distribute modified versions of this
52: manual under the conditions for verbatim copying, provided that the entire
53: resulting derived work is distributed under the terms of a permission
54: notice identical to this one.
55:
56: Permission is granted to copy and distribute translations of this manual
57: into another language, under the above conditions for modified versions,
58: except that this permission notice may be stated in a translation approved
59: by the Foundation.
60: @end titlepage
61:
62: @node Top, , , (dir)
63:
64: @ifinfo
65: This file documents the @code{gzip} command to compress files.
66: @end ifinfo
67:
68: @menu
69: * Copying:: How you can copy and share @code{gzip}.
70: * Overview:: Preliminary information.
71: * Sample:: Sample output from @code{gzip}.
72: * Invoking gzip:: How to run @code{gzip}.
73: * Advanced usage:: Concatenated files.
74: * Environment:: The @code{GZIP} environment variable
75: * Problems:: Reporting bugs.
76: * Concept Index:: Index of concepts.
77: @end menu
78:
79: @node Copying, Overview, , Top
80: @include gpl.texinfo
81:
82: @node Overview, Sample, Copying, Top
83: @chapter Overview
84: @cindex overview
85:
86: @code{Gzip} reduces the size of the named files using Lempel-Ziv coding
87: (LZ77). Whenever possible, each file is replaced by one with the
88: extension ".z", while keeping the same ownership modes, access and
89: modification times. (The extension is "-z" for VMS, "z" for MSDOS, OS/2
90: and Atari.) If no files are specified, the standard input is compressed
91: to the standard output. If the new file name is too long, @code{gzip}
92: truncates it and keeps the original file name in the compressed file.
93: @code{gzip} will only attempt to compress regular files. In particular,
94: it will ignore symbolic links.
95:
96: Compressed files can be restored to their original form using
97: "@code{gzip} -d" or @code{gunzip} or @code{zcat}.
98:
99: @code{gunzip} takes a list of files on its command line and replaces
100: each file whose name ends with ".z" or ".Z" and which begins with the
101: correct magic number with an uncompressed file without the original
102: extension. @code{gunzip} also recognizes the special extensions ".tgz"
103: and ".taz" as shorthands for ".tar.z" or ".tar.Z".
104:
105: @code{gunzip} can currently decompress files created by @code{gzip},
106: @code{zip}, @code{compress} or @code{pack}. The detection of the input
107: format is automatic. When using the first two formats, @code{gunzip}
108: checks a 32 bit CRC (cyclic redundancy check). For @code{pack},
109: @code{gunzip} checks the uncompressed length. The @code{compress}
110: format was not designed to allow consistency checks. However @code{gunzip}
111: is sometimes able to detect a bad .Z file. If you get an error
112: when uncompressing a .Z file, do not assume that the .Z file is
113: correct simply because the standard @code{uncompress} does not complain.
114: This generally means that the standard @code{uncompress} does not check its
115: input, and happily generates garbage output.
116:
117: Files created by @code{zip} can be uncompressed by @code{gzip} only if
118: they have a single member compressed with the 'deflation' method. This
119: feature is only intended to help conversion of @code{tar.zip} files to
120: the @code{tar.z} format. To extract @code{zip} files with several
121: members, use @code{unzip} instead of @code{gunzip}.
122:
123: @code{zcat} is identical to "@code{gunzip} -c". @code{zcat}
124: uncompresses either a list of files on the command line or its standard
125: input and writes the uncompressed data on standard output. @code{zcat}
126: will uncompress files that have the correct magic number whether they
127: have a ".z" suffix or not.
128:
129: @code{gzip} uses the Lempel-Ziv algorithm used in @code{zip} and PKZIP.
130: The amount of compression obtained depends on the size of the input and
131: the distribution of common substrings. Typically, text such as source
132: code or English is reduced by 60-70%. Compression is generally much
133: better than that achieved by LZW (as used in @code{compress}), Huffman
134: coding (as used in @code{pack}), or adaptive Huffman coding
135: (@code{compact}).
136:
137: Compression is always performed, even if the compressed file is slightly
138: larger than the original. The worst case expansion is a few bytes for
139: the gzip file header, plus 5 bytes every 32K block, or an expansion
140: ratio of 0.015% for large files. @code{gzip} preserves the mode,
141: ownership and timestamps of files when compressing or decompressing.
142:
143: @node Sample, Invoking gzip, Overview, Top
144: @chapter Sample Output
145: @cindex sample
146:
147: Here are some realistic examples of running @code{gzip}.
148:
149: This is the output of the command @samp{gzip}:
150:
151: @example
152: usage: gzip [-cdfhLrv19] [file ...]
153: For more help, type: gzip -h
154: @end example
155:
156: This is the output of the command @samp{gzip -h}:
157:
158: @example
159: gzip 1.0.5 (4 Mar 93)
160: usage: gzip [-cdfhLrtvV19] [file ...]
161: -c --stdout write on standard output, keep original files unchanged
162: -d --decompress decompress
163: -f --force force overwrite of output file and compress links
164: -h --help give this help
165: -L --license display software license
166: -q --quiet suppress all warnings
167: -r --recurse recurse through directories
168: -t --test test compressed file integrity (implies -d)
169: -v --verbose verbose mode
170: -V --version display version number
171: -1 --fast compress faster
172: -9 --best compress better
173: file... files to (de)compress. If none given, use standard input
174: @end example
175:
176: This is the output of the command @samp{gzip -v gzip.c}:
177:
178: @example
179: gzip.c: 69.8% -- replaced with gzip.c.z
180: @end example
181:
182: @node Invoking gzip, Advanced usage, Sample, Top
183: @chapter Invoking @code{gzip}
184: @cindex invoking
185: @cindex options
186:
187: The format for running the @code{gzip} program is:
188:
189: @example
190: gzip @var{option} @dots{}
191: @end example
192:
193: @code{gzip} supports the following options:
194:
195: @table @samp
196: @item --help
197: @itemx -h
198: Print an informative help message describing the options.
199:
200: @item --stdout
201: @itemx -c
202: Write output on standard output; keep original files unchanged.
203: If there are several input files, the output consists of a sequence of
204: independently compressed members. To obtain better compression,
205: concatenate all input files before compressing them.
206:
207: @item --decompress
208: @itemx -d
209: Decompress.
210:
211: @item --force
212: @itemx -f
213: Force compression or decompression even if the file has multiple links
214: or the corresponding file already exists. If -f is not given, and
215: when not running in the background, @code{gzip} prompts to verify
216: whether an existing file should be overwritten.
217:
218: @item --help
219: @itemx -h
220: Display a help screen.
221:
222: @item --license
223: @itemx -L
224: Display the @code{gzip} license.
225:
226: @item --recurse
227: @itemx -r
228: Travel the directory structure recursively. If any of the file names
229: specified on the command line are directories, @code{gzip} will descend
230: into the directory and compress all the files it finds there (or
231: decompress them in the case of @code{gunzip}).
232:
233: @item --test
234: @itemx -t
235: Test. Check the compressed file integrity.
236:
237: @item --verbose
238: @itemx -v
239: Verbose. Display the name and percentage reduction for each file compressed.
240:
241: @item --version
242: @itemx -V
243: Version. Display the version number and compilation options.
244:
245: @item --fast
246: @itemx --best
247: @itemx -#
248: Regulate the speed of compression using the specified digit #, where -1
249: or --fast indicates the fastest compression method (less compression)
250: and --best or -9 indicates the slowest compression method (optimal
251: compression). The default compression level is -5.
252: @end table
253:
254: @node Advanced usage, Environment, Invoking gzip, Top
255: @chapter Advanced usage
256: @cindex concatenated files
257:
258: Multiple compressed files can be concatenated. In this case,
259: @code{gunzip} will extract all members at once. If one member is
260: damaged, other members might still be recovered after removal of the
261: damaged member. Better compression can be usually obtained if all
262: members are decompressed then recompressed in a single step.
263:
264: This is an example of concatenating gzip files:
265:
266: @example
267: gzip -c file1 > foo.z
268: gzip -c file2 >> foo.z
269: @end example
270:
271: Then
272:
273: @example
274: gunzip -c foo
275: @end example
276:
277: is equivalent to
278:
279: @example
280: cat file1 file2
281: @end example
282:
283: In case of damage to one member of a .z file, other members can
284: still be recovered (if the damaged member is removed). However,
285: you can get better compression by compressing all members at once:
286:
287: @example
288: cat file1 file2 | gzip > foo.z
289: @end example
290:
291: compresses better than
292:
293: @example
294: gzip -c file1 file2 > foo.z
295: @end example
296:
297: If you want to recompress concatenated files to get better compression, do:
298:
299: @example
300: zcat old.z | gzip > new.z
301: @end example
302:
303: @node Environment, Problems, Advanced usage, Top
304: @chapter Environment
305: @cindex Environment
306:
307: The environment variable @code{GZIP} can hold a set of default options for
308: gzip. These options are interpreted first and can be ovewritten by
309: explicit command line parameters. For example:
310:
311: @example
312: for sh: GZIP="-8 -v"; export GZIP
313: for csh: setenv GZIP "-8 -v"
314: for MSDOS: set GZIP=-8 -v
315: @end example
316:
317: On Vax/VMS, the name of the environment variable is @code{GZIP_OPT}, to
318: avoid a conflict with the symbol set for invocation of the program.
319:
320: @node Problems, Concept Index, Environment, Top
321: @chapter Reporting Bugs
322: @cindex bugs
323:
324: If you find a bug in @code{gzip}, please send electronic mail to
325: @w{@samp{jloup@@chorus.fr}} or, if this fails, to
326: @w{@samp{bug-gnu-utils@@prep.ai.mit.edu}}. Include the version number,
327: which you can find by running @w{@samp{gzip -V}}. Also include in your
328: message the hardware and operating system, the compiler used to compile,
329: a description of the bug behavior, and the input to gzip that triggered
330: the bug.@refill
331:
332: @node Concept Index, , Problems, Top
333: @unnumbered Concept Index
334:
335: @printindex cp
336:
337: @shortcontents
338: @contents
339: @bye
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.