A tarball is a group of files that are bundled together using the tar command.
- Use following command line to uncompress .tar.gz file. For example, name.tar.gz
$ tar xvzf name.tar.gz
Where,
x = Tells tar to extract the files.
v = Stands for “verbose” will list all of the files one by one in the archive.
z = Tells the tar command to uncompress the file (gzip).
f = Tells tar to give it a file name to work with. - To uncompress into a different directory
$ tar xvzf name.tar.gz -C /path/to/directory
Where,
c = change the directory - To extract specificc file from .tar.gz tarball. For example, myfile.php
$ tar -xvzf name.tar.gz myfile.php
- To view detailed file list
$ tar -tvf name.tar.gz