unzip tar code example

Example 1: how to untar tar.gz

tar xvzf file.tar.gz

Example 2: unzip tar.gz

tar -xvf file.tar.gz

Example 3: tar unpack

tar -xzf packed.tar.gz

Example 4: how to unzip Tar file

## Untar files in Current Directory ##
tar -xvf filename.tar.gz

## Untar files in specified Directory ##
tar -xvf filename.tar.gz -C /path_name_for_unzip/

-x : extract
-C : specified directory
-v : Verbosely show the .tar file progress.
-f : filename of archive file

Example 5: uncompress tar

tar -xvf filename.tar

Example 6: extract tar.gz

tar -xf archive.tar.gz

Tags:

Misc Example