bzip2 is a free software/open source data compression algorithm and program developed by Julian Seward. Seward made the first public release of bzip2, version 0.15, in July 1996. The compressor's stability and popularity grew over the next several years, and Seward released version 1.0 in late 2000.
In some cases, bzip2 is surpassed by 7z and RAR formats in terms of absolute compression efficiency. With the constant effect of Moore's Law making computer time less and less important, compression methods like these have become quite popular. According to the author, bzip2 gets within ten to fifteen percent of the "best" class of compression algorithms currently known (PPM), although it is roughly twice as fast at compression and six times faster at decompression.
bzip2 uses the Burrows-Wheeler transform to convert frequently recurring character sequences into strings of identical letters, and then applies a move-to-front transform and finally Huffman coding. In bzip2 the blocks are all the same size in plaintext, which can be selected by a command-line argument, and are marked in compresstext by an arbitrary bit sequence derived from the decimal representation of pi.
Originally, bzip2's ancestor bzip used arithmetic coding after the blocksort; this was discontinued because of the patent restriction.
bzip2's command line flags are mostly the same as in gzip. So, to extract from a bzip2-compressed tar-file:
bzip2 -cd archivefile.tar.bz2 | tar -xvf -
To create a bzip2-compressed tar-file:
tar -cvf - filenames | bzip2 -9 > archivefile.tar.bz2
GNU tar supports a -j flag, which allows creation of tar.bz2 files without a pipeline: tar -cvjf archivefile.tar.bz2 file-list
Decompressing in GNU tar: tar -xvjf archivefile.tar.bz2
Lossless compression algorithms Free data compression software Archive formats Unix software
Bzip2 | Bzip2 | Bzip2 | Bzip2 | Bzip2 | Bzip2 | Bzip2 | Bzip2 | Bzip2 | Bzip2 | Bzip2