how to unzip .tar file in linux code example

Example 1: unzip a tar.gz file in linux

tar -xvzf community_images.tar.gz

Example 2: 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 3: unzip tar.xz linux

tar -xf archive.tar.xz -C /home/linuxize/files

Example 4: how to unzip using tar

tar -xf archive.tar.gz