LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   tarballs (https://www.linuxquestions.org/questions/linux-general-1/tarballs-29555/)

moger 09-04-2002 02:55 AM

tarballs
 
Hi, I have a question about tar files.

Let's say I want to back up my /home directory:

$ tar cvzf backup.tgz /home

So now I have backup.tgz. When I extract it, I notice it extracts into the same directory as my backup, /home. What if, for instance, I want it to extract into the /usr/blah directory instead? How would I do that? Does tar have a "dest =" type of option in it?

MartBrooks 09-04-2002 03:10 AM

Just change into the directory you would like it extracted to.

Regards

moger 09-04-2002 03:12 AM

Hm...I thought I did that before and it installed in the directory I created it from. I have to try that again.

born4linux 09-04-2002 03:15 AM

tar -C /targetdir -x tarfile

moger 09-04-2002 03:17 AM

Quote:

Originally posted by born4linux
tar -C /targetdir -x tarfile
And that would put "tarfile" in /targetdir right? If so, that is what I am looking for; thanks.


All times are GMT -5. The time now is 06:01 PM.