LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 06: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, 08: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, 06: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, 01: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, 10: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



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 10:37 AM
tar and gzip c0c0deuz Linux - General 2 10-31-2002 03:04 PM
gzip-1.2.4.tar Install ljc Linux - General 3 01-20-2002 09:44 PM
dd, tar and gzip nabil Linux - General 3 01-18-2002 04:51 PM
Need Serious Help With Tar And Gzip!! Please! rootlinux Linux - General 2 12-16-2001 01:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:21 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
Open Source Consulting | Domain Registration