Wednesday, June 8, 2016

How to create and extract .tar.gz archive

One of the most common compression formats used inGNU/Linux and variants is tar.gz. A tar.gz file is nothing but a gzipped tar archive. These days users of GNU/Linuxsystem seldom have to use the command line to create or extract tar.gz archives. But it is a useful command to keep in your arsenal if you are a system administrator.

To create a tar.gz archive from a given folder you can use the following command 

tar -zcvf tar-archive-name.tar.gz source-folder-name 

This will compress the contents of source-folder-name to a tar.gz archive named tar-archive-name.tar.gz

To extract a tar.gz compressed archive you can use the following command 

tar -zxvf tar-archive-name.tar.gz 

This will extract the archive to the folder tar-archive-name. 

No comments:

Post a Comment