how to unzip tar file code example

Example 1: 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 2: untar .tar file

tar -xvf yourfile.tar

Example 3: how to unzip using tar

tar -xf archive.tar.gz

Example 4: how to untar a tar file

tar -zxvf file_name.tar.gz

Example 5: Unzip tar file

tar xvf spark-*

Tags:

Misc Example