FileCompression

Revision 1 as of 2005-07-21 02:40:45

Clear message

I'm going to discuss the simple way of handling the popular GNU Tar compression format (tar.gz) & the BZ2 format (.bz2) via the command line (terminal).

Uncompressing a GNU Tar archive

GNU Tar

Example: file.tar.gz

tar -zxvf file.tar.gz

There, you're done, you'll have a folder with the contents of the compressed file.

BZ2

Example: file.tar.bz2

tar -jxvf file.tar.bz2

Creating GNU Tar archive

tar -cvf file.tar dir1 dir2 ...

file.tar is the name of the tar file we wish to create and dir1 dir2 are the names of the directories and/or files we wish to include in the tar archive. We can then compress the archive using gzip or bzip2.

Using gzip type

gzip file.tar

This will create file.tar.gz

Using bzip type

bzip2 file.tar

This will create file.tar.bz2