Want to unpack tarball into specified directory

Asked by Sam Quintanar on 2010-07-17

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:
2010-07-18
Last query:
2010-07-18
Last reply:
2010-07-18
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.

Sam Quintanar (robosq) said : #2

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