source: trunk/essentials/sys-libs/bzip2/bzip2.1@ 3320

Last change on this file since 3320 was 3318, checked in by bird, 19 years ago

bzip2 1.0.4

File size: 15.9 KB
Line 
1.PU
2.TH bzip2 1
3.SH NAME
4bzip2, bunzip2 \- a block-sorting file compressor, v1.0.4
5.br
6bzcat \- decompresses files to stdout
7.br
8bzip2recover \- recovers data from damaged bzip2 files
9
10.SH SYNOPSIS
11.ll +8
12.B bzip2
13.RB [ " \-cdfkqstvzVL123456789 " ]
14[
15.I "filenames \&..."
16]
17.ll -8
18.br
19.B bunzip2
20.RB [ " \-fkvsVL " ]
21[
22.I "filenames \&..."
23]
24.br
25.B bzcat
26.RB [ " \-s " ]
27[
28.I "filenames \&..."
29]
30.br
31.B bzip2recover
32.I "filename"
33
34.SH DESCRIPTION
35.I bzip2
36compresses files using the Burrows-Wheeler block sorting
37text compression algorithm, and Huffman coding. Compression is
38generally considerably better than that achieved by more conventional
39LZ77/LZ78-based compressors, and approaches the performance of the PPM
40family of statistical compressors.
41
42The command-line options are deliberately very similar to
43those of
44.I GNU gzip,
45but they are not identical.
46
47.I bzip2
48expects a list of file names to accompany the
49command-line flags. Each file is replaced by a compressed version of
50itself, with the name "original_name.bz2".
51Each compressed file
52has the same modification date, permissions, and, when possible,
53ownership as the corresponding original, so that these properties can
54be correctly restored at decompression time. File name handling is
55naive in the sense that there is no mechanism for preserving original
56file names, permissions, ownerships or dates in filesystems which lack
57these concepts, or have serious file name length restrictions, such as
58MS-DOS.
59
60.I bzip2
61and
62.I bunzip2
63will by default not overwrite existing
64files. If you want this to happen, specify the \-f flag.
65
66If no file names are specified,
67.I bzip2
68compresses from standard
69input to standard output. In this case,
70.I bzip2
71will decline to
72write compressed output to a terminal, as this would be entirely
73incomprehensible and therefore pointless.
74
75.I bunzip2
76(or
77.I bzip2 \-d)
78decompresses all
79specified files. Files which were not created by
80.I bzip2
81will be detected and ignored, and a warning issued.
82.I bzip2
83attempts to guess the filename for the decompressed file
84from that of the compressed file as follows:
85
86 filename.bz2 becomes filename
87 filename.bz becomes filename
88 filename.tbz2 becomes filename.tar
89 filename.tbz becomes filename.tar
90 anyothername becomes anyothername.out
91
92If the file does not end in one of the recognised endings,
93.I .bz2,
94.I .bz,
95.I .tbz2
96or
97.I .tbz,
98.I bzip2
99complains that it cannot
100guess the name of the original file, and uses the original name
101with
102.I .out
103appended.
104
105As with compression, supplying no
106filenames causes decompression from
107standard input to standard output.
108
109.I bunzip2
110will correctly decompress a file which is the
111concatenation of two or more compressed files. The result is the
112concatenation of the corresponding uncompressed files. Integrity
113testing (\-t)
114of concatenated
115compressed files is also supported.
116
117You can also compress or decompress files to the standard output by
118giving the \-c flag. Multiple files may be compressed and
119decompressed like this. The resulting outputs are fed sequentially to
120stdout. Compression of multiple files
121in this manner generates a stream
122containing multiple compressed file representations. Such a stream
123can be decompressed correctly only by
124.I bzip2
125version 0.9.0 or
126later. Earlier versions of
127.I bzip2
128will stop after decompressing
129the first file in the stream.
130
131.I bzcat
132(or
133.I bzip2 -dc)
134decompresses all specified files to
135the standard output.
136
137.I bzip2
138will read arguments from the environment variables
139.I BZIP2
140and
141.I BZIP,
142in that order, and will process them
143before any arguments read from the command line. This gives a
144convenient way to supply default arguments.
145
146Compression is always performed, even if the compressed
147file is slightly
148larger than the original. Files of less than about one hundred bytes
149tend to get larger, since the compression mechanism has a constant
150overhead in the region of 50 bytes. Random data (including the output
151of most file compressors) is coded at about 8.05 bits per byte, giving
152an expansion of around 0.5%.
153
154As a self-check for your protection,
155.I
156bzip2
157uses 32-bit CRCs to
158make sure that the decompressed version of a file is identical to the
159original. This guards against corruption of the compressed data, and
160against undetected bugs in