helpfulstuff.org Logo





Home arrow Linux arrow Working With Archives/Packages and Compressed Files (tar.gz, tar.bz2, & .zip files) Make Text BiggerMake Text SmallerReset Text Size
Working With Archives/Packages and Compressed Files (tar.gz, tar.bz2, & .zip files) PDF Print E-mail
Written by Trevor Gontz   

gzip and gunzip

gzip (GNU Zip) is the command used to compress files and gunzip (GNU unzip) is command used to decompress files. Files compressed with gzip have a .gz suffix.

Example: 

To compress a file using gzip you would type:

gzip file_name

Specific Example:

To compress a file name budget.ods (.ods is the extension for an OpenDocument Spreadsheet) you would type:

gzip  budget.ods

tar

tar (tape archive) is the command used to archive/package and extract tar files.

To extract a tar file you would type:

tar -xzvf name_of_archive.tar.gz

Specific example:

To extract the file Joomla_1.0.11-Stable-Full_Package.tar.gz in the current directory you would type:

tar -xzvf Joomla_1.0.11-Stable-Full_Package.tar.g

To archive a directory using tar you would type:

tar -czvf file_name.tar.gz directory_to_archive

Specific Example:

To create an archive of john_doe's home folder you would type

tar -czvf john_doe.tar.gz /home/john_doe

*Note: When tar used to create an archive the file ends up being a compressed tar file with the .gz suffix (gzip compression).

Last Updated ( Friday, 15 February 2008 )
 
< Prev   Next >
Linux Links

Major Distributions