Last Updated: February 25, 2016
·
1.027K
· i-arindam

Unzip with tar in different destination

while

tar -xzvf

are the standard switches for unzipping a .tar.gz file where

1) -x is for extract, as expected
2) -z is for gzipped file, similar to its name
3) -v is for verbose, which is pretty constant across commands
4) -f is for specifying the file, which is pretty standard and expected

the output is usually a directory of the tar file name in the current directory.

If however you want to unzip to a dest_folder use the -C switch, like so

tar -xzvf file.tar.gz -C my/path

Simple but very useful in day-to-day jobs

2 Responses
Add your response

Good to know

over 1 year ago ·

Why are you still using "z" parameter, while you can use tar xvf?

over 1 year ago ·