LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 09-04-2002, 02:55 AM   #1
moger
Member
 
Registered: Sep 2002
Distribution: Fedora Core 3
Posts: 247

Rep: Reputation: 30
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?
 
Old 09-04-2002, 03:10 AM   #2
MartBrooks
Member
 
Registered: May 2002
Location: London
Distribution: Debian
Posts: 388

Rep: Reputation: 31
Just change into the directory you would like it extracted to.

Regards
 
Old 09-04-2002, 03:12 AM   #3
moger
Member
 
Registered: Sep 2002
Distribution: Fedora Core 3
Posts: 247

Original Poster
Rep: Reputation: 30
Hm...I thought I did that before and it installed in the directory I created it from. I have to try that again.
 
Old 09-04-2002, 03:15 AM   #4
born4linux
Senior Member
 
Registered: Sep 2002
Location: Philippines
Distribution: Slackware, RHEL&variants, AIX, SuSE
Posts: 1,127

Rep: Reputation: 49
tar -C /targetdir -x tarfile
 
Old 09-04-2002, 03:17 AM   #5
moger
Member
 
Registered: Sep 2002
Distribution: Fedora Core 3
Posts: 247

Original Poster
Rep: Reputation: 30
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unistalling tarballs senthilkumaran Slackware 3 10-18-2003 05:36 PM
can you use rsync on tarballs wedgeworth Linux - Software 1 09-24-2003 07:48 PM
Tarballs Carlip Linux - Distributions 3 08-21-2003 01:47 PM
rpm and tarballs jleakey77 Linux - Newbie 3 08-15-2003 04:12 PM
tarballs MasterC Linux - General 5 05-15-2002 01:44 PM


All times are GMT -5. The time now is 07:06 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration