Home

bzip2

bzip2 is a data compression program and format that uses a block-sorting algorithm to compress data. It was created by Julian Seward and first released in 1996 as part of the bzip family. The compressor works on individual blocks of input data, with block sizes configurable from 100 kilobytes to 900 kilobytes (the default is 900 kilobytes). A .bz2 file consists of a sequence of compressed blocks, each with its own metadata, assembled into a single stream.

On each block, bzip2 applies the Burrows-Wheeler transform to reorder the bytes into a form that is

libbzip2 provides the decompression and compression functionality as a library, and many tools use it to offer

In practice, bzip2 generally offers higher compression ratios than gzip for many data types, at the cost

more
amenable
to
compression.
This
is
followed
by
a
move-to-front
transform,
a
run-length
encoding
step,
and
finally
Huffman
coding
to
produce
the
bitstream.
The
blockwise
design
allows
relatively
good
compression
while
enabling
streaming
and
random
access
in
some
cases,
but
it
also
means
memory
usage
and
compression
time
grow
with
block
size.
.bz2
support.
The
format
is
often
used
to
compress
tar
archives,
yielding
file
names
with
a
.tar.bz2
extension.
of
slower
compression.
Decompression
is
typically
fast,
and
memory
usage
scales
with
the
chosen
block
size.
bzip2
has
become
a
standard
tool
in
Unix-like
environments
and
is
widely
supported
across
operating
systems.