|
|
1.1 root 1: .PU
2: .TH COMPRESS 1 local
3: .SH NAME
4: compress, uncompress, zcat \- compress and expand data
5: .SH SYNOPSIS
6: .ll +8
7: .B compress
8: [
9: .B \-f
10: ] [
11: .B \-v
12: ] [
13: .B \-c
14: ] [
15: .B \-V
16: ] [
17: .B \-b
18: .I bits
19: ] [
20: .I "name \&..."
21: ]
22: .ll -8
23: .br
24: .B uncompress
25: [
26: .B \-f
27: ] [
28: .B \-v
29: ] [
30: .B \-c
31: ] [
32: .B \-V
33: ] [
34: .I "name \&..."
35: ]
36: .br
37: .B zcat
38: [
39: .B \-V
40: ] [
41: .I "name \&..."
42: ]
43: .SH DESCRIPTION
44: .I Compress
45: reduces the size of the named files using adaptive Lempel-Ziv coding.
46: Whenever possible,
47: each file is replaced by one with the extension
48: .B "\&.Z,"
49: while keeping the same ownership modes, access and modification times.
50: If no files are specified, the standard input is compressed to the
51: standard output.
52: Compressed files can be restored to their original form using
53: .I uncompress
54: or
55: .I zcat.
56: .PP
57: The
58: .B \-f
59: option will force compression of
60: .I name.
61: This is useful for compressing an entire directory,
62: even if some of the files do not actually shrink.
63: If
64: .B \-f
65: is not given and
66: .I compress
67: is run in the foreground,
68: the user is prompted as to whether an existing file should be overwritten.
69: .PP
70: The
71: .B \-c
72: option makes
73: .I compress/uncompress
74: write to the standard output; no files are changed.
75: The nondestructive behavior of
76: .I zcat
77: is identical to that of
78: .I uncompress
79: .B \-c.
80: .PP
81: .I Compress
82: uses the modified Lempel-Ziv algorithm popularized in
83: "A Technique for High Performance Data Compression",
84: Terry A. Welch,
85: .I "IEEE Computer,"
86: vol. 17, no. 6 (June 1984), pp. 8-19.
87: Common substrings in the file are first replaced by 9-bit codes 257 and up.
88: When code 512 is reached, the algorithm switches to 10-bit codes and
89: continues to use more bits until the
90: limit specified by the
91: .B \-b
92: flag is reached (default 16).
93: .I Bits
94: must be between 9 and 16. The default can be changed in the source to allow
95: .I compress
96: to be run on a smaller machine.
97: .PP
98: After the
99: .I bits
100: limit is attained,
101: .I compress
102: periodically checks the compression ratio. If it is increasing,
103: .I compress
104: continues to use the existing code dictionary. However,
105: if the compression ratio decreases,
106: .I compress
107: discards the table of substrings and rebuilds it from scratch. This allows
108: the algorithm to adapt to the next "block" of the file.
109: .PP
110: Note that the
111: .B \-b
112: flag is omitted for
113: .I uncompress,
114: since the
115: .I bits
116: parameter specified during compression
117: is encoded within the output, along with
118: a magic number to ensure that neither decompression of random data nor
119: recompression of compressed data is attempted.
120: .PP
121: .ne 8
122: The amount of compression obtained depends on the size of the
123: input, the number of
124: .I bits
125: per code, and the distribution of common substrings.
126: Typically, text such as source code or English
127: is reduced by 50\-60%.
128: Compression is generally much better than that achieved by
129: Huffman coding (as used in
130: .IR pack ),
131: or adaptive Huffman coding
132: .RI ( compact ),
133: and takes less time to compute.
134: .PP
135: Under the
136: .B \-v
137: option,
138: a message is printed yielding the percentage of
139: reduction for each file compressed.
140: .PP
141: If the
142: .B \-V
143: option is specified, the current version and compile options are printed on
144: stderr.
145: .PP
146: Exit status is normally 0;
147: if the last file is larger after (attempted) compression, the status is 2;
148: if an error occurs, exit status is 1.
149: .SH "SEE ALSO"
150: pack(1), compact(1)
151: .SH "DIAGNOSTICS"
152: Usage: compress [\-dfvcV] [\-b maxbits] [file ...]
153: .in +8
154: Invalid options were specified on the command line.
155: .in -8
156: Missing maxbits
157: .in +8
158: Maxbits must follow
159: .BR \-b \.
160: .in -8
161: .IR file :
162: not in compressed format
163: .in +8
164: The file specified to
165: .I uncompress
166: has not been compressed.
167: .in -8
168: .IR file :
169: compressed with
170: .I xx
171: bits, can only handle
172: .I yy
173: bits
174: .in +8
175: .I File
176: was compressed by a program that could deal with
177: more
178: .I bits
179: than the compress code on this machine.
180: Recompress the file with smaller
181: .IR bits \.
182: .in -8
183: .IR file :
184: already has .Z suffix -- no change
185: .in +8
186: The file is assumed to be already compressed.
187: Rename the file and try again.
188: .in -8
189: .IR file :
190: filename too long to tack on .Z
191: .in +8
192: The file cannot be compressed because its name is longer than
193: 12 characters.
194: Rename and try again.
195: This message does not occur on BSD systems.
196: .in -8
197: .I file
198: already exists; do you wish to overwrite (y or n)?
199: .in +8
200: Respond "y" if you want the output file to be replaced; "n" if not.
201: .in -8
202: uncompress: corrupt input
203: .in +8
204: A SIGSEGV violation was detected which usually means that the input file has
205: been corrupted.
206: .in -8
207: Compression:
208: .I "xx.xx%"
209: .in +8
210: Percentage of the input saved by compression.
211: (Relevant only for
212: .BR \-v \.)
213: .in -8
214: -- not a regular file: unchanged
215: .in +8
216: When the input file is not a regular file,
217: (e.g. a directory), it is
218: left unaltered.
219: .in -8
220: -- has
221: .I xx
222: other links: unchanged
223: .in +8
224: The input file has links; it is left unchanged. See
225: .IR ln "(1)"
226: for more information.
227: .in -8
228: -- file unchanged
229: .in +8
230: No savings is achieved by
231: compression. The input remains virgin.
232: .in -8
233: .SH "BUGS"
234: Although compressed files are compatible between machines with large memory,
235: .BR \-b \12
236: should be used for file transfer to architectures with
237: a small process data space (64KB or less, as exhibited by the DEC PDP
238: series, the Intel 80286, etc.)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.