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.

Get Linux Pocket Guide, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.