LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-02-2002, 07:50 PM   #1
RedHat123
Member
 
Registered: Dec 2001
Posts: 60

Rep: Reputation: 15
Question tar and gzip - how do i point to a output directory


I want to run tar with the xvzf options on a .tgz file - but is there any way to do this from some directory A and have the unzipped files be placed in another directory B ? Im too lazy to move the file then run tar
 
Old 09-02-2002, 09:38 PM   #2
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
How about consulting man page for tar?
Quote:
-C, --directory DIR
change to directory DIR
 
Old 09-03-2002, 07:26 AM   #3
born4linux
Senior Member
 
Registered: Sep 2002
Location: Philippines
Distribution: Slackware, RHEL&variants, AIX, SuSE
Posts: 1,127

Rep: Reputation: 49
let's say you have the tar file

/home/redhat123/package.tar.gz

and you want to extract it to

/tmp/source/

You can use this command to extract the contents of the tar file to /tmp/source:

tar -C /tmp/source -xzvf /home/redhat123/package.tar.gz

watch out for the spaces and syntax. If you want a GUI, you can ark (in RHL it is present, i dunno about other distros):

ark package.tar.gz

And you can just drag and drop to a directory.
 
Old 09-04-2002, 02:13 PM   #4
brangnutux
LQ Newbie
 
Registered: Jul 2002
Location: DC
Distribution: Mandrake 8.1
Posts: 11

Rep: Reputation: 0
cd to whatever directory you want the archive to be placed in. Then run your command pointing to the proper file. The archive will be untarred into the working (current) directory.
 
Old 04-20-2011, 11:48 AM   #5
kevomac12
LQ Newbie
 
Registered: Apr 2011
Posts: 1

Rep: Reputation: 0
Angry -C parameter for tar

If the archive doesn't support the -C you'll get... "File -C not present in the archive"! You won't be able to add an output local for the un-tar operation.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to untar and unzip .tar.gzip.part file? linuxharsha Linux - Software 2 02-14-2004 11:37 AM
tar and gzip c0c0deuz Linux - General 2 10-31-2002 04:04 PM
gzip-1.2.4.tar Install ljc Linux - General 3 01-20-2002 10:44 PM
dd, tar and gzip nabil Linux - General 3 01-18-2002 05:51 PM
Need Serious Help With Tar And Gzip!! Please! rootlinux Linux - General 2 12-16-2001 02:39 PM


All times are GMT -5. The time now is 08:13 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration