Add the -C
option (or --directory
, it is the same):
tar –xzf filename.tgz -C /target/directory
From man tar
:
-C, --directory DIR
change to directory DIR
سؤال
I am trying to decompress a tar (.TGZ) file, but want to decompress it into a new directory called newdir
.
The command I am using to decompress is: tar –xzf filename.tgz
How can I expand that to decompress it into newdir
?
المحلول
Add the -C
option (or --directory
, it is the same):
tar –xzf filename.tgz -C /target/directory
From man tar
:
-C, --directory DIR
change to directory DIR