manbook 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/Gemfile +15 -0
- data/Gemfile.lock +25 -0
- data/LICENSE.txt +20 -0
- data/README.md +105 -0
- data/Rakefile +46 -0
- data/TODO +2 -0
- data/VERSION +1 -0
- data/bin/manbook +89 -0
- data/bin/mktoc +157 -0
- data/lib/manbook.rb +30 -0
- data/lib/manbook/errors.rb +22 -0
- data/lib/manbook/formatter.rb +27 -0
- data/lib/manbook/html_formatter.rb +17 -0
- data/lib/manbook/log_formatter.rb +9 -0
- data/lib/manbook/parser.rb +32 -0
- data/templates/_page.html.erb +1 -0
- data/templates/about.html.erb +6 -0
- data/templates/application.html.erb +23 -0
- data/templates/index.html.erb +4 -0
- data/templates/library_books.jpg +0 -0
- data/templates/manbook.ncx.erb +28 -0
- data/templates/manbook.opf.erb +35 -0
- data/test/fixtures/bash.html +11352 -0
- data/test/fixtures/cat.html +195 -0
- data/test/fixtures/git.html +1882 -0
- data/test/fixtures/gunzip.html +595 -0
- data/test/fixtures/less.html +3554 -0
- data/test/fixtures/ls.html +818 -0
- data/test/fixtures/man.html +649 -0
- data/test/helper.rb +42 -0
- data/test/unit/test_manbook.rb +39 -0
- data/test/unit/test_mktoc.rb +215 -0
- metadata +189 -0
@@ -0,0 +1,595 @@
|
|
1
|
+
<!-- Creator : groff version 1.19.2 -->
|
2
|
+
<!-- CreationDate: Tue Nov 29 21:01:37 2011 -->
|
3
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/html4/loose.dtd">
|
5
|
+
<html>
|
6
|
+
<head>
|
7
|
+
<meta name="generator" content="groff -Thtml, see www.gnu.org">
|
8
|
+
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
9
|
+
<meta name="Content-Style" content="text/css">
|
10
|
+
<style type="text/css">
|
11
|
+
p { margin-top: 0; margin-bottom: 0; }
|
12
|
+
pre { margin-top: 0; margin-bottom: 0; }
|
13
|
+
table { margin-top: 0; margin-bottom: 0; }
|
14
|
+
</style>
|
15
|
+
<title>GZIP</title>
|
16
|
+
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
|
20
|
+
<h1 align=center>GZIP</h1>
|
21
|
+
|
22
|
+
<a href="#NAME">NAME</a><br>
|
23
|
+
<a href="#SYNOPSIS">SYNOPSIS</a><br>
|
24
|
+
<a href="#DESCRIPTION">DESCRIPTION</a><br>
|
25
|
+
<a href="#OPTIONS">OPTIONS</a><br>
|
26
|
+
<a href="#ADVANCED USAGE">ADVANCED USAGE</a><br>
|
27
|
+
<a href="#ENVIRONMENT">ENVIRONMENT</a><br>
|
28
|
+
<a href="#SEE ALSO">SEE ALSO</a><br>
|
29
|
+
<a href="#DIAGNOSTICS">DIAGNOSTICS</a><br>
|
30
|
+
<a href="#CAVEATS">CAVEATS</a><br>
|
31
|
+
<a href="#BUGS">BUGS</a><br>
|
32
|
+
<a href="#COPYRIGHT NOTICE">COPYRIGHT NOTICE</a><br>
|
33
|
+
|
34
|
+
<hr>
|
35
|
+
|
36
|
+
|
37
|
+
<a name="NAME"></a>
|
38
|
+
<h2>NAME</h2>
|
39
|
+
|
40
|
+
|
41
|
+
<p style="margin-left:11%; margin-top: 1em">gzip, gunzip,
|
42
|
+
zcat − compress or expand files</p>
|
43
|
+
|
44
|
+
<a name="SYNOPSIS"></a>
|
45
|
+
<h2>SYNOPSIS</h2>
|
46
|
+
|
47
|
+
|
48
|
+
<p style="margin-left:11%; margin-top: 1em"><b>gzip</b> [
|
49
|
+
<b>−acdfhlLnNrtvV19</b> ]
|
50
|
+
[<b>−S suffix</b>] [ <i>name ...</i> ] <b><br>
|
51
|
+
gunzip</b> [ <b>−acfhlLnNrtvV</b> ]
|
52
|
+
[<b>−S suffix</b>] [ <i>name ...</i> ] <b><br>
|
53
|
+
zcat</b> [ <b>−fhLV</b> ] [ <i>name ...</i> ]</p>
|
54
|
+
|
55
|
+
<a name="DESCRIPTION"></a>
|
56
|
+
<h2>DESCRIPTION</h2>
|
57
|
+
|
58
|
+
|
59
|
+
<p style="margin-left:11%; margin-top: 1em"><i>Gzip</i>
|
60
|
+
reduces the size of the named files using Lempel-Ziv coding
|
61
|
+
(LZ77). Whenever possible, each file is replaced by one with
|
62
|
+
the extension <b>.gz,</b> while keeping the same ownership
|
63
|
+
modes, access and modification times. (The default extension
|
64
|
+
is <b>−gz</b> for VMS, <b>z</b> for MSDOS, OS/2 FAT,
|
65
|
+
Windows NT FAT and Atari.) If no files are specified, or if
|
66
|
+
a file name is "-", the standard input is
|
67
|
+
compressed to the standard output. <i>Gzip</i> will only
|
68
|
+
attempt to compress regular files. In particular, it will
|
69
|
+
ignore symbolic links.</p>
|
70
|
+
|
71
|
+
<p style="margin-left:11%; margin-top: 1em">If the
|
72
|
+
compressed file name is too long for its file system,
|
73
|
+
<i>gzip</i> truncates it. <i>Gzip</i> attempts to truncate
|
74
|
+
only the parts of the file name longer than 3 characters. (A
|
75
|
+
part is delimited by dots.) If the name consists of small
|
76
|
+
parts only, the longest parts are truncated. For example, if
|
77
|
+
file names are limited to 14 characters, gzip.msdos.exe is
|
78
|
+
compressed to gzi.msd.exe.gz. Names are not truncated on
|
79
|
+
systems which do not have a limit on file name length.</p>
|
80
|
+
|
81
|
+
<p style="margin-left:11%; margin-top: 1em">By default,
|
82
|
+
<i>gzip</i> keeps the original file name and timestamp in
|
83
|
+
the compressed file. These are used when decompressing the
|
84
|
+
file with the <b>−N</b> option. This is useful when
|
85
|
+
the compressed file name was truncated or when the time
|
86
|
+
stamp was not preserved after a file transfer.</p>
|
87
|
+
|
88
|
+
<p style="margin-left:11%; margin-top: 1em">Compressed
|
89
|
+
files can be restored to their original form using <i>gzip
|
90
|
+
-d</i> or <i>gunzip</i> or <i>zcat.</i> If the original name
|
91
|
+
saved in the compressed file is not suitable for its file
|
92
|
+
system, a new name is constructed from the original one to
|
93
|
+
make it legal.</p>
|
94
|
+
|
95
|
+
<p style="margin-left:11%; margin-top: 1em"><i>gunzip</i>
|
96
|
+
takes a list of files on its command line and replaces each
|
97
|
+
file whose name ends with .gz, -gz, .z, -z, _z or .Z and
|
98
|
+
which begins with the correct magic number with an
|
99
|
+
uncompressed file without the original extension.
|
100
|
+
<i>gunzip</i> also recognizes the special extensions
|
101
|
+
<b>.tgz</b> and <b>.taz</b> as shorthands for <b>.tar.gz</b>
|
102
|
+
and <b>.tar.Z</b> respectively. When compressing,
|
103
|
+
<i>gzip</i> uses the <b>.tgz</b> extension if necessary
|
104
|
+
instead of truncating a file with a <b>.tar</b>
|
105
|
+
extension.</p>
|
106
|
+
|
107
|
+
<p style="margin-left:11%; margin-top: 1em"><i>gunzip</i>
|
108
|
+
can currently decompress files created by <i>gzip, zip,
|
109
|
+
compress, compress -H</i> or <i>pack.</i> The detection of
|
110
|
+
the input format is automatic. When using the first two
|
111
|
+
formats, <i>gunzip</i> checks a 32 bit CRC. For <i>pack,
|
112
|
+
gunzip</i> checks the uncompressed length. The standard
|
113
|
+
<i>compress</i> format was not designed to allow consistency
|
114
|
+
checks. However <i>gunzip</i> is sometimes able to detect a
|
115
|
+
bad .Z file. If you get an error when uncompressing a .Z
|
116
|
+
file, do not assume that the .Z file is correct simply
|
117
|
+
because the standard <i>uncompress</i> does not complain.
|
118
|
+
This generally means that the standard <i>uncompress</i>
|
119
|
+
does not check its input, and happily generates garbage
|
120
|
+
output. The SCO compress -H format (lzh compression method)
|
121
|
+
does not include a CRC but also allows some consistency
|
122
|
+
checks.</p>
|
123
|
+
|
124
|
+
<p style="margin-left:11%; margin-top: 1em">Files created
|
125
|
+
by <i>zip</i> can be uncompressed by gzip only if they have
|
126
|
+
a single member compressed with the ’deflation’
|
127
|
+
method. This feature is only intended to help conversion of
|
128
|
+
tar.zip files to the tar.gz format. To extract a <i>zip</i>
|
129
|
+
file with a single member, use a command like <i>gunzip
|
130
|
+
<foo.zip</i> or <i>gunzip -S .zip foo.zip</i>. To extract
|
131
|
+
zip files with several members, use <i>unzip</i> instead of
|
132
|
+
<i>gunzip.</i></p>
|
133
|
+
|
134
|
+
<p style="margin-left:11%; margin-top: 1em"><i>zcat</i> is
|
135
|
+
identical to <i>gunzip</i> <b>−c.</b> (On some
|
136
|
+
systems, <i>zcat</i> may be installed as <i>gzcat</i> to
|
137
|
+
preserve the original link to <i>compress.) zcat</i>
|
138
|
+
uncompresses either a list of files on the command line or
|
139
|
+
its standard input and writes the uncompressed data on
|
140
|
+
standard output. <i>zcat</i> will uncompress files that have
|
141
|
+
the correct magic number whether they have a <b>.gz</b>
|
142
|
+
suffix or not. In POSIX mode zcat will append <b>.Z</b> to
|
143
|
+
all filenames that do not have that suffix.</p>
|
144
|
+
|
145
|
+
<p style="margin-left:11%; margin-top: 1em"><i>Gzip</i>
|
146
|
+
uses the Lempel-Ziv algorithm used in <i>zip</i> and PKZIP.
|
147
|
+
The amount of compression obtained depends on the size of
|
148
|
+
the input and the distribution of common substrings.
|
149
|
+
Typically, text such as source code or English is reduced by
|
150
|
+
60−70%. Compression is generally much better than that
|
151
|
+
achieved by LZW (as used in <i>compress</i>), Huffman coding
|
152
|
+
(as used in <i>pack</i>), or adaptive Huffman coding
|
153
|
+
(<i>compact</i>).</p>
|
154
|
+
|
155
|
+
<p style="margin-left:11%; margin-top: 1em">Compression is
|
156
|
+
always performed, even if the compressed file is slightly
|
157
|
+
larger than the original. The worst case expansion is a few
|
158
|
+
bytes for the gzip file header, plus 5 bytes every 32K
|
159
|
+
block, or an expansion ratio of 0.015% for large files. Note
|
160
|
+
that the actual number of used disk blocks almost never
|
161
|
+
increases. <i>gzip</i> preserves the mode, ownership and
|
162
|
+
timestamps of files when compressing or decompressing.</p>
|
163
|
+
|
164
|
+
<p style="margin-left:11%; margin-top: 1em">The <i>gzip</i>
|
165
|
+
file format is specified in P. Deutsch, <small>GZIP</small>
|
166
|
+
file format specification version 4.3,
|
167
|
+
<ftp://ftp.isi.edu/in-notes/rfc1952.txt>, Internet RFC
|
168
|
+
1952 (May 1996). The <i>zip</i> deflation format is
|
169
|
+
specified in P. Deutsch, <small>DEFLATE</small> Compressed
|
170
|
+
Data Format Specification version 1.3,
|
171
|
+
<ftp://ftp.isi.edu/in-notes/rfc1951.txt>, Internet RFC
|
172
|
+
1951 (May 1996).</p>
|
173
|
+
|
174
|
+
<a name="OPTIONS"></a>
|
175
|
+
<h2>OPTIONS</h2>
|
176
|
+
|
177
|
+
|
178
|
+
<p style="margin-left:11%; margin-top: 1em"><b>−a
|
179
|
+
--ascii</b></p>
|
180
|
+
|
181
|
+
<p style="margin-left:22%;">Ascii text mode: convert
|
182
|
+
end-of-lines using local conventions. This option is
|
183
|
+
supported only on some non-Unix systems. For MSDOS, CR LF is
|
184
|
+
converted to LF when compressing, and LF is converted to CR
|
185
|
+
LF when decompressing.</p>
|
186
|
+
|
187
|
+
<p style="margin-left:11%;"><b>−c --stdout
|
188
|
+
--to-stdout</b></p>
|
189
|
+
|
190
|
+
<p style="margin-left:22%;">Write output on standard
|
191
|
+
output; keep original files unchanged. If there are several
|
192
|
+
input files, the output consists of a sequence of
|
193
|
+
independently compressed members. To obtain better
|
194
|
+
compression, concatenate all input files before compressing
|
195
|
+
them.</p>
|
196
|
+
|
197
|
+
<p style="margin-left:11%;"><b>−d --decompress
|
198
|
+
--uncompress</b></p>
|
199
|
+
|
200
|
+
<p style="margin-left:22%;">Decompress.</p>
|
201
|
+
|
202
|
+
<p style="margin-left:11%;"><b>−f --force</b></p>
|
203
|
+
|
204
|
+
<p style="margin-left:22%;">Force compression or
|
205
|
+
decompression even if the file has multiple links or the
|
206
|
+
corresponding file already exists, or if the compressed data
|
207
|
+
is read from or written to a terminal. If the input data is
|
208
|
+
not in a format recognized by <i>gzip,</i> and if the option
|
209
|
+
--stdout is also given, copy the input data without change
|
210
|
+
to the standard output: let <i>zcat</i> behave as
|
211
|
+
<i>cat.</i> If <b>−f</b> is not given, and when not
|
212
|
+
running in the background, <i>gzip</i> prompts to verify
|
213
|
+
whether an existing file should be overwritten.</p>
|
214
|
+
|
215
|
+
<p style="margin-left:11%;"><b>−h --help</b></p>
|
216
|
+
|
217
|
+
<p style="margin-left:22%;">Display a help screen and
|
218
|
+
quit.</p>
|
219
|
+
|
220
|
+
<p style="margin-left:11%;"><b>−l --list</b></p>
|
221
|
+
|
222
|
+
<p style="margin-left:22%;">For each compressed file, list
|
223
|
+
the following fields:</p>
|
224
|
+
|
225
|
+
<p style="margin-left:22%; margin-top: 1em">compressed
|
226
|
+
size: size of the compressed file <br>
|
227
|
+
uncompressed size: size of the uncompressed file <br>
|
228
|
+
ratio: compression ratio (0.0% if unknown) <br>
|
229
|
+
uncompressed_name: name of the uncompressed file</p>
|
230
|
+
|
231
|
+
<p style="margin-left:22%; margin-top: 1em">The
|
232
|
+
uncompressed size is given as -1 for files not in gzip
|
233
|
+
format, such as compressed .Z files. To get the uncompressed
|
234
|
+
size for such a file, you can use:</p>
|
235
|
+
|
236
|
+
<p style="margin-left:22%; margin-top: 1em">zcat file.Z |
|
237
|
+
wc -c</p>
|
238
|
+
|
239
|
+
<p style="margin-left:22%; margin-top: 1em">In combination
|
240
|
+
with the --verbose option, the following fields are also
|
241
|
+
displayed:</p>
|
242
|
+
|
243
|
+
<p style="margin-left:22%; margin-top: 1em">method:
|
244
|
+
compression method <br>
|
245
|
+
crc: the 32-bit CRC of the uncompressed data <br>
|
246
|
+
date & time: time stamp for the uncompressed file</p>
|
247
|
+
|
248
|
+
<p style="margin-left:22%; margin-top: 1em">The compression
|
249
|
+
methods currently supported are deflate, compress, lzh (SCO
|
250
|
+
compress -H) and pack. The crc is given as ffffffff for a
|
251
|
+
file not in gzip format.</p>
|
252
|
+
|
253
|
+
<p style="margin-left:22%; margin-top: 1em">With --name,
|
254
|
+
the uncompressed name, date and time are those stored within
|
255
|
+
the compress file if present.</p>
|
256
|
+
|
257
|
+
<p style="margin-left:22%; margin-top: 1em">With --verbose,
|
258
|
+
the size totals and compression ratio for all files is also
|
259
|
+
displayed, unless some sizes are unknown. With --quiet, the
|
260
|
+
title and totals lines are not displayed.</p>
|
261
|
+
|
262
|
+
<p style="margin-left:11%;"><b>−L --license</b></p>
|
263
|
+
|
264
|
+
<p style="margin-left:22%;">Display the <i>gzip</i> license
|
265
|
+
and quit.</p>
|
266
|
+
|
267
|
+
<p style="margin-left:11%;"><b>−n --no-name</b></p>
|
268
|
+
|
269
|
+
<p style="margin-left:22%;">When compressing, do not save
|
270
|
+
the original file name and time stamp by default. (The
|
271
|
+
original name is always saved if the name had to be
|
272
|
+
truncated.) When decompressing, do not restore the original
|
273
|
+
file name if present (remove only the <i>gzip</i> suffix
|
274
|
+
from the compressed file name) and do not restore the
|
275
|
+
original time stamp if present (copy it from the compressed
|
276
|
+
file). This option is the default when decompressing.</p>
|
277
|
+
|
278
|
+
<p style="margin-left:11%;"><b>−N --name</b></p>
|
279
|
+
|
280
|
+
<p style="margin-left:22%;">When compressing, always save
|
281
|
+
the original file name and time stamp; this is the default.
|
282
|
+
When decompressing, restore the original file name and time
|
283
|
+
stamp if present. This option is useful on systems which
|
284
|
+
have a limit on file name length or when the time stamp has
|
285
|
+
been lost after a file transfer.</p>
|
286
|
+
|
287
|
+
<p style="margin-left:11%;"><b>−q --quiet</b></p>
|
288
|
+
|
289
|
+
<p style="margin-left:22%;">Suppress all warnings.</p>
|
290
|
+
|
291
|
+
<p style="margin-left:11%;"><b>−r --recursive</b></p>
|
292
|
+
|
293
|
+
<p style="margin-left:22%;">Travel the directory structure
|
294
|
+
recursively. If any of the file names specified on the
|
295
|
+
command line are directories, <i>gzip</i> will descend into
|
296
|
+
the directory and compress all the files it finds there (or
|
297
|
+
decompress them in the case of <i>gunzip</i> ).</p>
|
298
|
+
|
299
|
+
<p style="margin-left:11%;"><b>−S .suf --suffix
|
300
|
+
.suf</b></p>
|
301
|
+
|
302
|
+
<p style="margin-left:22%;">Use suffix .suf instead of .gz.
|
303
|
+
Any suffix can be given, but suffixes other than .z and .gz
|
304
|
+
should be avoided to avoid confusion when files are
|
305
|
+
transferred to other systems. A null suffix forces gunzip to
|
306
|
+
try decompression on all given files regardless of suffix,
|
307
|
+
as in:</p>
|
308
|
+
|
309
|
+
<p style="margin-left:22%; margin-top: 1em">gunzip -S
|
310
|
+
"" * (*.* for MSDOS)</p>
|
311
|
+
|
312
|
+
<p style="margin-left:22%; margin-top: 1em">Previous
|
313
|
+
versions of gzip used the .z suffix. This was changed to
|
314
|
+
avoid a conflict with <i>pack</i>(1)<i>.</i></p>
|
315
|
+
|
316
|
+
<p style="margin-left:11%;"><b>−t --test</b></p>
|
317
|
+
|
318
|
+
<p style="margin-left:22%;">Test. Check the compressed file
|
319
|
+
integrity.</p>
|
320
|
+
|
321
|
+
<p style="margin-left:11%;"><b>−v --verbose</b></p>
|
322
|
+
|
323
|
+
<p style="margin-left:22%;">Verbose. Display the name and
|
324
|
+
percentage reduction for each file compressed or
|
325
|
+
decompressed.</p>
|
326
|
+
|
327
|
+
<p style="margin-left:11%;"><b>−V --version</b></p>
|
328
|
+
|
329
|
+
<p style="margin-left:22%;">Version. Display the version
|
330
|
+
number and compilation options then quit.</p>
|
331
|
+
|
332
|
+
<p style="margin-left:11%;"><b>−# --fast
|
333
|
+
--best</b></p>
|
334
|
+
|
335
|
+
<p style="margin-left:22%;">Regulate the speed of
|
336
|
+
compression using the specified digit <i>#</i>, where
|
337
|
+
<b>−1</b> or <b>−−fast</b> indicates the
|
338
|
+
fastest compression method (less compression) and
|
339
|
+
<b>−9</b> or <b>−−best</b> indicates the
|
340
|
+
slowest compression method (best compression). The default
|
341
|
+
compression level is <b>−6</b> (that is, biased
|
342
|
+
towards high compression at expense of speed).</p>
|
343
|
+
|
344
|
+
<a name="ADVANCED USAGE"></a>
|
345
|
+
<h2>ADVANCED USAGE</h2>
|
346
|
+
|
347
|
+
|
348
|
+
<p style="margin-left:11%; margin-top: 1em">Multiple
|
349
|
+
compressed files can be concatenated. In this case,
|
350
|
+
<i>gunzip</i> will extract all members at once. For
|
351
|
+
example:</p>
|
352
|
+
|
353
|
+
<p style="margin-left:11%; margin-top: 1em">gzip -c file1
|
354
|
+
> foo.gz <br>
|
355
|
+
gzip -c file2 >> foo.gz</p>
|
356
|
+
|
357
|
+
<p style="margin-left:11%; margin-top: 1em">Then</p>
|
358
|
+
|
359
|
+
<p style="margin-left:11%; margin-top: 1em">gunzip -c
|
360
|
+
foo</p>
|
361
|
+
|
362
|
+
<p style="margin-left:11%; margin-top: 1em">is equivalent
|
363
|
+
to</p>
|
364
|
+
|
365
|
+
<p style="margin-left:11%; margin-top: 1em">cat file1
|
366
|
+
file2</p>
|
367
|
+
|
368
|
+
<p style="margin-left:11%; margin-top: 1em">In case of
|
369
|
+
damage to one member of a .gz file, other members can still
|
370
|
+
be recovered (if the damaged member is removed). However,
|
371
|
+
you can get better compression by compressing all members at
|
372
|
+
once:</p>
|
373
|
+
|
374
|
+
<p style="margin-left:11%; margin-top: 1em">cat file1 file2
|
375
|
+
| gzip > foo.gz</p>
|
376
|
+
|
377
|
+
<p style="margin-left:11%; margin-top: 1em">compresses
|
378
|
+
better than</p>
|
379
|
+
|
380
|
+
<p style="margin-left:11%; margin-top: 1em">gzip -c file1
|
381
|
+
file2 > foo.gz</p>
|
382
|
+
|
383
|
+
<p style="margin-left:11%; margin-top: 1em">If you want to
|
384
|
+
recompress concatenated files to get better compression,
|
385
|
+
do:</p>
|
386
|
+
|
387
|
+
<p style="margin-left:11%; margin-top: 1em">gzip -cd old.gz
|
388
|
+
| gzip > new.gz</p>
|
389
|
+
|
390
|
+
<p style="margin-left:11%; margin-top: 1em">If a compressed
|
391
|
+
file consists of several members, the uncompressed size and
|
392
|
+
CRC reported by the --list option applies to the last member
|
393
|
+
only. If you need the uncompressed size for all members, you
|
394
|
+
can use:</p>
|
395
|
+
|
396
|
+
<p style="margin-left:11%; margin-top: 1em">gzip -cd
|
397
|
+
file.gz | wc -c</p>
|
398
|
+
|
399
|
+
<p style="margin-left:11%; margin-top: 1em">If you wish to
|
400
|
+
create a single archive file with multiple members so that
|
401
|
+
members can later be extracted independently, use an
|
402
|
+
archiver such as tar or zip. GNU tar supports the -z option
|
403
|
+
to invoke gzip transparently. gzip is designed as a
|
404
|
+
complement to tar, not as a replacement.</p>
|
405
|
+
|
406
|
+
<a name="ENVIRONMENT"></a>
|
407
|
+
<h2>ENVIRONMENT</h2>
|
408
|
+
|
409
|
+
|
410
|
+
<p style="margin-left:11%; margin-top: 1em">The environment
|
411
|
+
variable <b>GZIP</b> can hold a set of default options for
|
412
|
+
<i>gzip.</i> These options are interpreted first and can be
|
413
|
+
overwritten by explicit command line parameters. For
|
414
|
+
example: <br>
|
415
|
+
for sh: GZIP="-8v --name"; export GZIP <br>
|
416
|
+
for csh: setenv GZIP "-8v --name" <br>
|
417
|
+
for MSDOS: set GZIP=-8v --name</p>
|
418
|
+
|
419
|
+
<p style="margin-left:11%; margin-top: 1em">On Vax/VMS, the
|
420
|
+
name of the environment variable is GZIP_OPT, to avoid a
|
421
|
+
conflict with the symbol set for invocation of the
|
422
|
+
program.</p>
|
423
|
+
|
424
|
+
<a name="SEE ALSO"></a>
|
425
|
+
<h2>SEE ALSO</h2>
|
426
|
+
|
427
|
+
|
428
|
+
<p style="margin-left:11%; margin-top: 1em">znew(1),
|
429
|
+
zcmp(1), zmore(1), zforce(1), gzexe(1), zip(1), unzip(1),
|
430
|
+
compress(1), pack(1), compact(1), compat(5)</p>
|
431
|
+
|
432
|
+
<p style="margin-left:11%; margin-top: 1em">The <i>gzip</i>
|
433
|
+
file format is specified in P. Deutsch, <small>GZIP</small>
|
434
|
+
file format specification version 4.3,
|
435
|
+
<b><ftp://ftp.isi.edu/in-notes/rfc1952.txt></b>,
|
436
|
+
Internet RFC 1952 (May 1996). The <i>zip</i> deflation
|
437
|
+
format is specified in P. Deutsch, <small>DEFLATE</small>
|
438
|
+
Compressed Data Format Specification version 1.3,
|
439
|
+
<b><ftp://ftp.isi.edu/in-notes/rfc1951.txt></b>,
|
440
|
+
Internet RFC 1951 (May 1996).</p>
|
441
|
+
|
442
|
+
<a name="DIAGNOSTICS"></a>
|
443
|
+
<h2>DIAGNOSTICS</h2>
|
444
|
+
|
445
|
+
|
446
|
+
<p style="margin-left:11%; margin-top: 1em">Exit status is
|
447
|
+
normally 0; if an error occurs, exit status is 1. If a
|
448
|
+
warning occurs, exit status is 2. <br>
|
449
|
+
Usage: gzip [-cdfhlLnNrtvV19] [-S suffix] [file ...]</p>
|
450
|
+
|
451
|
+
<p style="margin-left:22%;">Invalid options were specified
|
452
|
+
on the command line.</p>
|
453
|
+
|
454
|
+
<p style="margin-left:11%;"><i>file</i>: not in gzip
|
455
|
+
format</p>
|
456
|
+
|
457
|
+
<p style="margin-left:22%;">The file specified to
|
458
|
+
<i>gunzip</i> has not been compressed.</p>
|
459
|
+
|
460
|
+
<p style="margin-left:11%;"><i>file</i>: Corrupt input. Use
|
461
|
+
zcat to recover some data.</p>
|
462
|
+
|
463
|
+
<p style="margin-left:22%;">The compressed file has been
|
464
|
+
damaged. The data up to the point of failure can be
|
465
|
+
recovered using</p>
|
466
|
+
|
467
|
+
<p style="margin-left:22%; margin-top: 1em">zcat
|
468
|
+
<i>file</i> > recover</p>
|
469
|
+
|
470
|
+
<p style="margin-left:11%;"><i>file</i>: compressed with
|
471
|
+
<i>xx</i> bits, can only handle <i>yy</i> bits</p>
|
472
|
+
|
473
|
+
<p style="margin-left:22%;"><i>File</i> was compressed
|
474
|
+
(using LZW) by a program that could deal with more
|
475
|
+
<i>bits</i> than the decompress code on this machine.
|
476
|
+
Recompress the file with gzip, which compresses better and
|
477
|
+
uses less memory.</p>
|
478
|
+
|
479
|
+
<p style="margin-left:11%;"><i>file</i>: already has .gz
|
480
|
+
suffix -- no change</p>
|
481
|
+
|
482
|
+
<p style="margin-left:22%;">The file is assumed to be
|
483
|
+
already compressed. Rename the file and try again.</p>
|
484
|
+
|
485
|
+
<p style="margin-left:11%;"><i>file</i> already exists; do
|
486
|
+
you wish to overwrite (y or n)?</p>
|
487
|
+
|
488
|
+
<p style="margin-left:22%;">Respond "y" if you
|
489
|
+
want the output file to be replaced; "n" if
|
490
|
+
not.</p>
|
491
|
+
|
492
|
+
<p style="margin-left:11%;">gunzip: corrupt input</p>
|
493
|
+
|
494
|
+
<p style="margin-left:22%;">A SIGSEGV violation was
|
495
|
+
detected which usually means that the input file has been
|
496
|
+
corrupted.</p>
|
497
|
+
|
498
|
+
<p style="margin-left:11%;"><i>xx.x%</i> Percentage of the
|
499
|
+
input saved by compression.</p>
|
500
|
+
|
501
|
+
<p style="margin-left:22%;">(Relevant only for
|
502
|
+
<b>−v</b> and <b>−l</b>.)</p>
|
503
|
+
|
504
|
+
<p style="margin-left:11%;">-- not a regular file or
|
505
|
+
directory: ignored</p>
|
506
|
+
|
507
|
+
<p style="margin-left:22%;">When the input file is not a
|
508
|
+
regular file or directory, (e.g. a symbolic link, socket,
|
509
|
+
FIFO, device file), it is left unaltered.</p>
|
510
|
+
|
511
|
+
<p style="margin-left:11%;">-- has <i>xx</i> other links:
|
512
|
+
unchanged</p>
|
513
|
+
|
514
|
+
<p style="margin-left:22%;">The input file has links; it is
|
515
|
+
left unchanged. See <i>ln</i>(1) for more information. Use
|
516
|
+
the <b>−f</b> flag to force compression of
|
517
|
+
multiply-linked files.</p>
|
518
|
+
|
519
|
+
<a name="CAVEATS"></a>
|
520
|
+
<h2>CAVEATS</h2>
|
521
|
+
|
522
|
+
|
523
|
+
<p style="margin-left:11%; margin-top: 1em">When writing
|
524
|
+
compressed data to a tape, it is generally necessary to pad
|
525
|
+
the output with zeroes up to a block boundary. When the data
|
526
|
+
is read and the whole block is passed to <i>gunzip</i> for
|
527
|
+
decompression, <i>gunzip</i> detects that there is extra
|
528
|
+
trailing garbage after the compressed data and emits a
|
529
|
+
warning by default. You have to use the --quiet option to
|
530
|
+
suppress the warning. This option can be set in the
|
531
|
+
<b>GZIP</b> environment variable as in: <br>
|
532
|
+
for sh: GZIP="-q" tar -xfz --block-compress
|
533
|
+
/dev/rst0 <br>
|
534
|
+
for csh: (setenv GZIP -q; tar -xfz --block-compr
|
535
|
+
/dev/rst0</p>
|
536
|
+
|
537
|
+
<p style="margin-left:11%; margin-top: 1em">In the above
|
538
|
+
example, gzip is invoked implicitly by the -z option of GNU
|
539
|
+
tar. Make sure that the same block size (-b option of tar)
|
540
|
+
is used for reading and writing compressed data on tapes.
|
541
|
+
(This example assumes you are using the GNU version of
|
542
|
+
tar.)</p>
|
543
|
+
|
544
|
+
<a name="BUGS"></a>
|
545
|
+
<h2>BUGS</h2>
|
546
|
+
|
547
|
+
|
548
|
+
<p style="margin-left:11%; margin-top: 1em">The gzip format
|
549
|
+
represents the input size modulo 2^32, so the --list option
|
550
|
+
reports incorrect uncompressed sizes and compression ratios
|
551
|
+
for uncompressed files 4 GB and larger. To work around this
|
552
|
+
problem, you can use the following command to discover a
|
553
|
+
large uncompressed file’s true size:</p>
|
554
|
+
|
555
|
+
<p style="margin-left:11%; margin-top: 1em">zcat file.gz |
|
556
|
+
wc -c</p>
|
557
|
+
|
558
|
+
<p style="margin-left:11%; margin-top: 1em">The --list
|
559
|
+
option reports sizes as -1 and crc as ffffffff if the
|
560
|
+
compressed file is on a non seekable media.</p>
|
561
|
+
|
562
|
+
<p style="margin-left:11%; margin-top: 1em">In some rare
|
563
|
+
cases, the --best option gives worse compression than the
|
564
|
+
default compression level (-6). On some highly redundant
|
565
|
+
files, <i>compress</i> compresses better than
|
566
|
+
<i>gzip.</i></p>
|
567
|
+
|
568
|
+
<a name="COPYRIGHT NOTICE"></a>
|
569
|
+
<h2>COPYRIGHT NOTICE</h2>
|
570
|
+
|
571
|
+
|
572
|
+
<p style="margin-left:11%; margin-top: 1em">Copyright
|
573
|
+
© 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
|
574
|
+
<br>
|
575
|
+
Copyright © 1992, 1993 Jean-loup Gailly</p>
|
576
|
+
|
577
|
+
<p style="margin-left:11%; margin-top: 1em">Permission is
|
578
|
+
granted to make and distribute verbatim copies of this
|
579
|
+
manual provided the copyright notice and this permission
|
580
|
+
notice are preserved on all copies.</p>
|
581
|
+
|
582
|
+
<p style="margin-left:11%; margin-top: 1em">Permission is
|
583
|
+
granted to copy and distribute modified versions of this
|
584
|
+
manual under the conditions for verbatim copying, provided
|
585
|
+
that the entire resulting derived work is distributed under
|
586
|
+
the terms of a permission notice identical to this one.</p>
|
587
|
+
|
588
|
+
<p style="margin-left:11%; margin-top: 1em">Permission is
|
589
|
+
granted to copy and distribute translations of this manual
|
590
|
+
into another language, under the above conditions for
|
591
|
+
modified versions, except that this permission notice may be
|
592
|
+
stated in a translation approved by the Foundation.</p>
|
593
|
+
<hr>
|
594
|
+
</body>
|
595
|
+
</html>
|