I am trying to unzip a tar file (.TGZ), but I want to unzip it into a new directory called newdir .
newdir
The command I use to unpack: tar –xzf filename.tgz
tar –xzf filename.tgz
How can I deploy this to unzip it to newdir ?
Add the -C option (or --directory , this is the same):
-C
--directory
tar –xzf filename.tgz -C /target/directory
From man tar :
man tar
-C, --directory DIRchange directory DIR
-C, --directory DIR
change directory DIR