LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   opening tar to another directory (https://www.linuxquestions.org/questions/linux-newbie-8/opening-tar-to-another-directory-629404/)

laucian 03-20-2008 03:48 AM

opening tar to another directory
 
hi everyone..
in /home/user1 there is a file.tar ..and i want to extract it to /home/user2/openedFiles...

i thought syntax should be

tar xvzf file.tar /home/user2/openedFiles

but there is something missing i guess, it doesn't work..can anyone help?

zeeshanhayat 03-20-2008 03:56 AM

tar -zxvf tarball.tar.gz -C <directory>

laucian 03-20-2008 03:57 AM

ohhh my god!!
why would they need an extra option tag for that?

reddazz 03-20-2008 03:57 AM

If its just a tar file, you can do
Code:

$tar xvf somefile.tar -C <directory>


All times are GMT -5. The time now is 08:59 AM.