9vpmzw
Last Updated: February 25, 2016
·
905
· i-arindam
971bb20678e83c73b15eb1e981ebe740

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

Say Thanks
Respond

2 Responses
Add your response

341
D

Good to know

over 1 year ago ·
6035
9b5758af4d1e0e13e6ee0c0379f3ec63

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

over 1 year ago ·