Bzip2
Encyclopedia : B : BZ : BZI : Bzip2
- The correct title of this } is }}}. The initial letter is capitalized due to [Naming conventions #Lower case first lettertechnical restrictions].
Compression efficiency
bzip2 compresses most files more effectively than more traditional gzip or ZIP, but is slower. In this manner it is fairly similar to other recent-generation compression algorithms. Unlike other formats such as RAR or ZIP (and similar to gzip), bzip2 is only a data compressor, not an archiver. The program itself has no facilities for multiple files, encryption or archive-splitting, in the UNIX tradition instead relying on separate external utilities such as tar and GnuPG for these tasks.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.
Use
In Unix, bzip2 can be used combined with or independently of tar: bzip2 file to compress and bzip2 -d file.bz2 to uncompress (the alias bunzip2 for decompression may also be used).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.bz2GNU tar supports a -j flag, which allows creation of tar.bz2 files without a pipeline:
tar -cvjf archivefile.tar.bz2 file-listDecompressing in GNU tar:
tar -xvjf archivefile.tar.bz2
See also
- redirect
External links
- [The bzip2 and libbzip2 home page]
- [Aminet: Search results for "bzip2"] (or Bzip2 for Amiga)
- [bzip2 for Windows]
- [Hobbes: Search results for: bzip2] (or Bzip2 for OS/2)
- [MacBzip2] (for Classic Mac OS; under Mac OS X, the standard bzip2 is available at the command line)
- [bzip2smp] (a parallel implementation of bzip2 for use on multiprocessor/multicore machines)
- [Introdution to Bzip2]
From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.
