doingword.com

Archive for the ‘Linux’ Category

How to compress a directory with tar

Wednesday, February 21st, 2007

Hi Guys,
If we need make a backup of a directory, the best options is use tar.
For example, you have a directory called /home/emanuelq/files and you would like to compress this directory,you can type tar command as follows:

  1. tar -zcvf backup.tar.gz /home/emanuelq/files

The above command will create an archive called backup.tar.gz in the current directory.
If you want to extract the content of the file you need to run this command.

  1. tar -vxfz backup.tar.gz

The above command will be extract the files in the current directory.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Posted in Linux | No Comments »