Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-14-2003, 02:35 PM
|
#1
|
Member
Registered: Aug 2003
Posts: 56
Rep:
|
Choosing where to extract tar.gz
How can i direct where my files gets extracted from tar.gz files?
I know that
'tar -xzvf [filename]' extracts the tar.gz files in the current directory where the tar.gz files are located.
But say i wanted the file to be extracted into 'usr/local' dirctory. How can i modify that command to make this possible?
So this is the simple diagram:
('tar.gz' file is in 'Desktop' directory) > (Command line) > (All the files in that 'tar.gz' gets extracted into 'usr/local' directory)
Any idea on how i can do this?
Thank You.
Last edited by Arclite; 08-14-2003 at 02:38 PM.
|
|
|
08-14-2003, 02:40 PM
|
#2
|
Member
Registered: Nov 2002
Location: Austria
Distribution: Redhat 9
Posts: 140
Rep:
|
i would change to the directory /usr/local/ and simply extract the files there 
|
|
|
08-14-2003, 02:46 PM
|
#3
|
Member
Registered: Aug 2003
Posts: 56
Original Poster
Rep:
|
Quote:
Originally posted by ichbinesderelch
i would change to the directory /usr/local/ and simply extract the files there
|
Problem is that i can't move anything in there unless i'm a root. In order to do this i need to use command to extract tar.gz file in there.
|
|
|
08-14-2003, 03:00 PM
|
#4
|
Member
Registered: Nov 2002
Location: Austria
Distribution: Redhat 9
Posts: 140
Rep:
|
but if you wanna put the extracted files there you need to get root anyway, so it wouldn't be a problem
|
|
|
08-14-2003, 03:04 PM
|
#5
|
Member
Registered: Aug 2003
Posts: 56
Original Poster
Rep:
|
Quote:
Originally posted by ichbinesderelch
but if you wanna put the extracted files there you need to get root anyway, so it wouldn't be a problem
|
Do u mean actually logging in as root?
I was thinking along the lines of:
'su' and become a root in the command line. Then i can just type whatever command to extract 'tar.gz' into that 'usr/local' directory.
I need the command that adds to 'tar -xzvf [filename]' so i can do this process.
|
|
|
08-14-2003, 03:07 PM
|
#6
|
Member
Registered: Nov 2002
Location: Austria
Distribution: Redhat 9
Posts: 140
Rep:
|
hhm, i didn't get your questions, but i would simply typ "su", root password, go to /usr/local/ and tar -xvzf [filename], so the files are in /usr/local/..?
|
|
|
08-14-2003, 03:21 PM
|
#7
|
Member
Registered: Aug 2003
Posts: 56
Original Poster
Rep:
|
Quote:
Originally posted by ichbinesderelch
hhm, i didn't get your questions, but i would simply typ "su", root password, go to /usr/local/ and tar -xvzf [filename], so the files are in /usr/local/..?
|
The Actual 'tar.gz' is on my Desktop, not in the usr/local.
I can't copy 'tar.gz' files into usr/local in the first place cause i'm not a root in GUI.
Thanks for your replys BTW  .
|
|
|
08-14-2003, 03:28 PM
|
#8
|
Member
Registered: Nov 2002
Location: Austria
Distribution: Redhat 9
Posts: 140
Rep:
|
ah, well, so you know the adress path of the desktop? i never save files on desktop so i don't really now it, but lets say the path of the desktop is //desktop:// or something, than change to /usr/local, and than tar -xvzf //desktop://xxx.tar.gz, you needn't to be in the directory where the tar.gz file is to untar it 
no problem.. 
|
|
|
08-14-2003, 03:33 PM
|
#9
|
Member
Registered: Aug 2003
Posts: 56
Original Poster
Rep:
|
Quote:
Originally posted by ichbinesderelch
ah, well, so you know the adress path of the desktop? i never save files on desktop so i don't really now it, but lets say the path of the desktop is //desktop:// or something, than change to /usr/local, and than tar -xvzf //desktop://xxx.tar.gz, you needn't to be in the directory where the tar.gz file is to untar it 
no problem..
|
I think this is it! Thx alot! I'm going to go try it  .
Your a lifesaver.
|
|
|
08-14-2003, 03:37 PM
|
#10
|
Member
Registered: Nov 2002
Location: Austria
Distribution: Redhat 9
Posts: 140
Rep:
|
well, hopefully i helped you 
good luck 
|
|
|
08-14-2003, 03:38 PM
|
#11
|
Member
Registered: Aug 2003
Posts: 56
Original Poster
Rep:
|
tar -xvzf //Desktop://MozillaFirebird-0.6.1-i686-pc-linux-gnu.tar.gz
hmmm? does that look right? I typed that in root mode was used it while i was in /usr/local
I get this error:
'
tar (child): Cannot execute remote shell: No such file or directory
tar (child): //Desktop\://MozillaFirebird-0.6.1-i686-pc-linux-gnu.tar.gz: Cannot open: Input/output error
tar (child): Error is not recoverable: exiting now
gzip: stdin: unexpected end of file
tar: Child returned status 2
tar: Error exit delayed from previous errors
'
Last edited by Arclite; 08-14-2003 at 03:42 PM.
|
|
|
08-14-2003, 03:45 PM
|
#12
|
Member
Registered: Nov 2002
Location: Austria
Distribution: Redhat 9
Posts: 140
Rep:
|
are you using gnome or kde
in case of gnome it would be ~/.gnome-desktop/xx.tar.gz, so all files on desktop would be in .gnome-desktop in your home directory,
if you are using kde maybe .kde-desktop, look with 'ls -a' in your home directory for it
|
|
|
08-14-2003, 03:46 PM
|
#13
|
Senior Member
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403
Rep:
|
In your HOME directory, there should be a directory called Desktop. Your file is in that directory.
To extract a TAR GZip (.tar.gz) file to another location, type:
Code:
tar -zxvf <myFile.tar.gz> -C /usr/local
|
|
|
08-14-2003, 03:52 PM
|
#14
|
Member
Registered: Aug 2003
Posts: 56
Original Poster
Rep:
|
I got it! Desktop was like u said Mat,
It was beneath other director such as home.
This code did it:
tar -xvzf //home//linux//Desktop//MozillaFire.tar.gz
Just to correct your previous post, there is no ':' after desktop or any other directory name
Thanks ichbinesderelch for all your help!
MathieuI i'm going go give that a try too just for learning. Altho i wish i knew what that '-C' means.  Thanks for your help too!
|
|
|
08-14-2003, 03:57 PM
|
#15
|
Senior Member
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403
Rep:
|
The -C option tells tar to put the contents in another location.
In this case /usr/local
|
|
|
All times are GMT -5. The time now is 05:21 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|