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