Compression and Archives

bzip2

Compresses files using bzip2.

bzip2 compresses individual files with good compression but slower speed than gzip.

Syntax
bzip2 [options] file...

Arguments explained

  • Options adjust output or behavior.
  • Arguments name the files, services, hosts, or values the command should work with.

Common examples

Compress a file
bzip2 -k data.log

Creates data.log.bz2 and keeps the original.

Compress tar output
tar -cf - project | bzip2 > project.tar.bz2

Creates a bzip2-compressed tar archive.

bzip2 Command
FieldDetails
Commandbzip2
CategoryCompression and Archives
Primary useCompresses files using bzip2.
Syntaxbzip2 [options] file...