bzip2
This chapter contains a copy of the bzip2
man page,
and nothing else.
NAME
bzip2
,bunzip2
- a block-sorting file compressor, v0.9.5bzcat
- decompresses files to stdoutbzip2recover
- recovers data from damaged bzip2 filesSYNOPSIS
bzip2
[ -cdfkqstvzVL123456789 ] [ filenames ... ]bunzip2
[ -fkvsVL ] [ filenames ... ]bzcat
[ -s ] [ filenames ... ]bzip2recover
filenameDESCRIPTION
bzip2
compresses files using the Burrows-Wheeler block sorting text compression algorithm, and Huffman coding. Compression is generally considerably better than that achieved by more conventional LZ77/LZ78-based compressors, and approaches the performance of the PPM family of statistical compressors.The command-line options are deliberately very similar to those of GNU
gzip
, but they are not identical.
bzip2
expects a list of file names to accompany the command-line flags. Each file is replaced by a compressed version of itself, with the nameoriginal_name.bz2
. Each compressed file has the same modification date, permissions, and, when possible, ownership as the corresponding original, so that these properties can be correctly restored at decompression time. File name handling is naive in the sense that there is no mechanism for preserving original file names, permissions, ownerships or dates in filesystems which lack these concepts, or have serious file name length restrictions, such as MS-DOS.
bzip2
andbunzip2
will by default not overwrite existing files. If you want this to happen, specify the-f
flag.If no file names are specified,
bzip2
compresses from standard input to standard output. In this case,bzip2
will decline to write compressed output to a terminal, as this would be entirely incomprehensible and therefore pointless.
bunzip2
(orbzip2 -d
) decompresses all specified files. Files which were not created bybzip2
will be detected and ignored, and a warning issued.bzip2
attempts to guess the filename for the decompressed file from that of the compressed file as follows:
filename.bz2
becomesfilename
filename.bz
becomesfilename
filename.tbz2
becomesfilename.tar
filename.tbz
becomesfilename.tar
anyothername
becomesanyothername.out
If the file does not end in one of the recognised endings,
.bz2
,.bz
,.tbz2
or.tbz
,bzip2
complains that it cannot guess the name of the original file, and uses the original name with.out
appended.As with compression, supplying no filenames causes decompression from standard input to standard output.
bunzip2
will correctly decompress a file which is the concatenation of two or more compressed files. The result is the concatenation of the corresponding uncompressed files. Integrity testing (-t
) of concatenated compr