O'Reilly logo

Linux Pocket Guide, 2nd Edition by Daniel J. Barrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

bzip2 — stdin  stdout  - file  -- opt  --help  --version

Synopsis

bzip2 [options] [files]

bzip2 and bunzip2 compress and uncompress files in Burrows-Wheeler format. Compressed files have the suffix .bz2.

Sample commands

bzip2 file

Compress file to create file.bz2. Original file is deleted.

bzip2 -c file

Produce compressed data on standard output.

cat file | bzip2

Produce compressed data on standard output.

bunzip2 file.bz2

Uncompress file.bz2 to create file. Original file.bz2 is deleted.

bunzip2 -c file.bz2

Uncompress the data on standard output.

cat file.bz2 | bunzip2

Uncompress the data on standard output.

bzcat file.bz2

Uncompress the data on standard output.

bzipped tar files: sample commands

tar -cjf myfile.tar.bz2 dirname

Pack.

tar -tjf -myfile.tar.bz2

List contents.

tar -xjf myfile.tar.bz2

Unpack.

Add the -v option to tar to print filenames as they are processed.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required