summaryrefslogtreecommitdiff
path: root/sys/man/1/gzip
blob: f56a6a2466a6e882a5d4f7ec6f2209c966786d28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
.TH GZIP 1
.SH NAME
gzip, gunzip, bzip2, bunzip2, compress, uncompress, zip, unzip \- compress and expand data
.SH SYNOPSIS
.B gzip
.RB [ -cvD [ 1-9 ]]
.RI [ file
.BR ... ]
.PP
.B gunzip
.RB [ -ctTvD ]
.RI [ file
.BR ... ]
.PP
.B bzip2
.RB [ -cvD [ 1-9 ]]
.RI [ file
.BR ... ]
.PP
.B bunzip2
.RB [ -cvD ]
.RI [ file
.BR ... ]
.PP
.B compress
[
.B -cv
] [
.I file
.B ...
]
.PP
.B uncompress
[
.B -cv
] [
.I file
.B ...
]
.PP
.B zip
.RB [ -avD [ 1-9 ]]
.RB [ -f
.IR zipfile ]
.I file
.RB [ ... ]
.PP
.B unzip
.RB [ -cistTvD ]
.RB [ -f
.IR zipfile ]
.RI [ file
.BR ... ]
.SH DESCRIPTION
.PP
.I Gzip
encodes files with a hybrid Lempel-Ziv 1977 and Huffman compression algorithm
known as
.BR deflate .
Most of the time, the resulting file is smaller,
and will never be much bigger.
Output files are named by taking the last path element of each file argument
and appending
.BR .gz ;
if the resulting name ends with
.BR .tar.gz ,
it is converted to
.B .tgz
instead.
.I Gunzip
reverses the process.
Its output files are named by taking the last path element of each file argument,
converting
.B .tgz
to
.BR .tar.gz ,
and stripping any
.BR .gz ;
the resulting name must be different from the original name.
.PP
.I Bzip2
and
.I bunzip2
are similar in interface to
.I gzip
and
.IR gunzip ,
but use a modified Burrows-Wheeler block sorting
compression algorithm.
The default suffix for output files is
.BR .bz2 ,
with
.B .tar.bz2
becoming
.BR .tbz .
.I Bunzip2
recognizes the extension 
.B .tbz2
as a synonym for
.BR .tbz .
.PP
.I Compress
and
.I uncompress
are similar in interface to
.I gzip
and
.IR gunzip ,
but use the Lempel-Ziv-Welch compression algorithm.
The default suffix for output files is
.BR .Z .
.I Compress
is one of the oldest widespread Unix compression programs.
.PP
.I Zip
encodes the named files and places the results into the archive
.IR zipfile ,
or the standard output if no file is given.
.I Unzip
extracts files from an archive created by
.IR zip .
If no files are named as arguments, all of files in the archive are extracted.
A directory's name implies all recursively contained files and subdirectories.
.I Zip
is the
.I "de facto"
standard for compression on Microsoft operating systems.
.PP
None of these programs removes the original files.
If the process fails, the faulty output files are removed.
.PP
The options are:
.TP 0.6i
.B -a
Automaticialy creates directories as needed, needed for zip files
created by broken implementations which omit directories.
.TP
.B -c
Write to standard output rather than creating an output file.
.TP
.B -i
Convert all archive file names to lower case.
.TP
.B -s
Streaming mode.  Looks at the file data adjacent to each compressed file
rather than seeking in the central file directory.
This is the mode used by
.I unzip
if no
.I zipfile
is specified.
If
.B -s
is given,
.B -T
is ignored.
.TP
.B -t
List matching files in the archive rather than extracting them.
.TP
.B -T
Set the output time to that specified in the archive.
.TP
.BR -1 " .. " -9
Sets the compression level.
.B -1
is tuned for speed,
.B -9
for minimal output size.
The best compromise is
.BR -6 ,
the default.
.TP
.B -v
Produce more descriptive output.
With
.BR -t ,
adds the uncompressed size in bytes and the modification time to the output.
Without
.BR -t ,
prints the names of files on standard error as they are compressed or decompressed.
.TP
.B -D
Produce debugging output.
.SH SOURCE
.B /sys/src/cmd/gzip
.br
.B /sys/src/cmd/bzip2
.br
.B /sys/src/cmd/compress
.SH SEE ALSO
.IR tar (1)
.br
"A Technique for High Performance Data Compression",
Terry A. Welch,
.IR "IEEE Computer" ,
vol. 17, no. 6 (June 1984), pp. 8-19.
.SH BUGS
.I Unzip
can only extract files which are uncompressed or compressed
with the
.B deflate
compression scheme.  Recent zip files fall into this category.
Very recent zip files may have tables of contents that 
.I unzip
cannot read.  Such files are still readable by invoking
.I unzip
with the
.B -s
option.