3 compress, uncompress, zcat \- compress and expand data
42 reduces the size of the named files using adaptive Lempel-Ziv coding.
44 each file is replaced by one with the extension
46 while keeping the same ownership modes, access and modification times.
47 If no files are specified, the standard input is compressed to the
49 Compressed files can be restored to their original form using
56 option will force compression of
58 This is useful for compressing an entire directory,
59 even if some of the files do not actually shrink.
64 is run in the foreground,
65 the user is prompted as to whether an existing file should be overwritten.
70 .I compress/uncompress
71 write to the standard output; no files are changed.
72 The nondestructive behavior of
74 is identical to that of
79 uses the modified Lempel-Ziv algorithm popularized in
80 "A Technique for High Performance Data Compression",
83 vol. 17, no. 6 (June 1984), pp. 8-19.
84 Common substrings in the file are first replaced by 9-bit codes 257 and up.
85 When code 512 is reached, the algorithm switches to 10-bit codes and
86 continues to use more bits until the
87 limit specified by the
89 flag is reached (default 16).
91 must be between 9 and 16. The default can be changed in the source to allow
93 to be run on a smaller machine.
99 periodically checks the compression ratio. If it is increasing,
101 continues to use the existing code dictionary. However,
102 if the compression ratio decreases,
104 discards the table of substrings and rebuilds it from scratch. This allows
105 the algorithm to adapt to the next "block" of the file.
113 parameter specified during compression
114 is encoded within the output, along with
115 a magic number to ensure that neither decompression of random data nor
116 recompression of compressed data is attempted.
119 The amount of compression obtained depends on the size of the
122 per code, and the distribution of common substrings.
123 Typically, text such as source code or English
124 is reduced by 50\-60%.
125 Compression is generally much better than that achieved by
126 Huffman coding (as used in
128 or adaptive Huffman coding
130 and takes less time to compute.
135 a message is printed yielding the percentage of
136 reduction for each file compressed.
140 option is specified, the current version and compile options are printed on
143 Exit status is normally 0;
144 if the last file is larger after (attempted) compression, the status is 2;
145 if an error occurs, exit status is 1.
149 Usage: compress [\-dfvcV] [\-b maxbits] [file ...]
151 Invalid options were specified on the command line.
159 not in compressed format
161 The file specified to
163 has not been compressed.
168 bits, can only handle
173 was compressed by a program that could deal with
176 than the compress code on this machine.
177 Recompress the file with smaller
181 already has .Z suffix -- no change
183 The file is assumed to be already compressed.
184 Rename the file and try again.
187 filename too long to tack on .Z
189 The file cannot be compressed because its name is longer than
191 Rename and try again.
192 This message does not occur on BSD systems.
195 already exists; do you wish to overwrite (y or n)?
197 Respond "y" if you want the output file to be replaced; "n" if not.
199 uncompress: corrupt input
201 A SIGSEGV violation was detected which usually means that the input file has
207 Percentage of the input saved by compression.
211 -- not a regular file: unchanged
213 When the input file is not a regular file,
214 (e.g. a directory), it is
219 other links: unchanged
221 The input file has links; it is left unchanged. See
223 for more information.
227 No savings is achieved by
228 compression. The input remains virgin.
231 .B \*9/src/cmd/compress/compress.c
233 Although compressed files are compatible between machines with large memory,
235 should be used for file transfer to architectures with
236 a small process data space (64KB or less, as exhibited by the DEC PDP
237 series, the Intel 80286, etc.)