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