tar

Overview

tar is a program which can be used to package and unpackage files using the .tar format.

What About .tar.gz Files?

.tar.gz files are files which have been packaged by tar, and then compressed with gzip. Fortunately, tar can both uncompress and unpackage in one step. Usually you would want to use the following command:

The above options are:

Argument Description
x  Instructs tar to decompress the archive.
v  Verbose output.
z  Tells tar to decompress the archive using gzip.
f  The file to decompress and unpackage. This must be the last argument in the group, and the file name must follow directly after.

Uncompress To Specific Folder

By default, tar will uncompress the files into the current working directory. Sometimes you will want to specify the folder manually. To do this with the GNU version for tar, you can use the -C option.

Note that destination_folder has to already exist, tar will not create it for you.

--directory is the long name for -C.