Want to unpack tarball into specified directory

Asked by Sam Quintanar

I know how to unpack a tar.gz tarball (tar -xzf tar-file-name.tar.gz), but I I'd like to know the command-line command to
unpack a .gz tarball that resides in directory "x" so it unpacks in directory "y".

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu tar Edit question
Assignee:
No assignee Edit question
Solved by:
Ian Ace
Solved:
Last query:
Last reply:
Revision history for this message
Best Ian Ace (iaculallad) said :
#1

Try it with:

tar xvzf file.tgz path/to/directory

or

tar xvzf /from/directory/file.tgz /path/to/directory

HTH.

Revision history for this message
Sam Quintanar (robosq) said :
#2

Thanks Ian Ace A. Culallad, that solved my question.