bzip2

Introduction

BZIP2 is a program to compress a single file; BUNZIP2 reverses the compression.

BZIP2 only compresses a single file at a time. It is not an archive program, like TAR or ZIP. A user interested in transmitted a single compressed archive of multiple files or directories should first use TAR or ZIP to create a single archive, and then apply BZIP2 to the entire archive file.

BZIP2 was created and is maintained by Julian Seward.

The project web site is http://www.bzip.org.

Documentation for bzip2 is available in Julian Seward, bzip2 and libbzip2, version 1.05, A program and library for data compression, which is available online at http://www.bzip.org/docs.html.

Availability

Version 1.0.6 of BZIP2 is installed on BlueRidge, Cascades, DragonsTooth, NewRiver, HokieOne and HokieSpeed.

Usage

The executables bzip2 and bunzip2 should automatically be in your path. The command

      bzip2 file.txt

will replace file.txt by a compressed version named file.txt.bz2. The corresponding command

      bunzip2 file.txt.bz2

will replace the compressed file by an uncompressed copy of the original file.txt.

Examples

Here is an example batch script which uses BZIP2 to compress, and BUNZIP2 to recover, a text file.

#! /bin/bash
#PBS -l walltime=00:05:00
#PBS -l nodes=1:ppn=1
#PBS -W group_list=newriver
#PBS -q open_q
#PBS -j oe

cd $PBS_O_WORKDIR
bzip2 robinson_crusoe.txt
bunzip2 robinson_crusoe.txt.bz2

A complete set of files to carry out a similar process are available in a tar file