The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How do I untar file through an ssh session? Joe McCaughan UNIX for Advanced & Expert Users 3 05-28-2008 03:01 PM
Tar utility (untar a .tar file) on VxWorks uday_01 UNIX for Advanced & Expert Users 1 05-26-2008 09:13 AM
unable to UNTAR a file NIMISH AGARWAL UNIX and Linux Applications 6 05-08-2008 11:35 PM
Untar a TAR file at different location malaymaru UNIX for Dummies Questions & Answers 5 09-18-2006 08:59 PM
unTar a specific file from remote gelbvonn Shell Programming and Scripting 2 05-25-2006 03:59 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-27-2006
melanie_pfefer melanie_pfefer is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 234
untar to a specified file

I have file1.tar and want to untar it under /server/file2.

If I do tar -xvf file1.tar, the files will be deployed under file1.

How to specify the destination folder??
thx
  #2 (permalink)  
Old 11-27-2006
lazytech lazytech is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 39
I suggest to place the tar file in the directory you would like the files to be untarred to. Then when you untar the files should be placed in that directory.
The exception is if the files were tarred with / preceding the path. Then the files will be untarred to the root directory.

You can determine where the files will be untarred by using the t option.
tar -tvf files.tar will show you the paths of where the files will be untarred.
  #3 (permalink)  
Old 11-27-2006
melanie_pfefer melanie_pfefer is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 234
thx. So I understand from you that I can't specify the location when untaring. Right??

thx
  #4 (permalink)  
Old 11-27-2006
lazytech lazytech is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 39
Its more like this. If you do a tar -tvf and you see that the paths are
myfiles/file1.txt
myfiles/file2.txt
if you put the tar file in /usr and extract it then the path for the files become
/usr/myfiles/file1.txt
/usr/myfiles/file2.txt

the only exception is if you do a tar -tvf and you see the paths are
/myfiles/file1.txt
/myfiles/file2.txt
then because of that leading / the file path for the files will become
/myfiles/file1.txt
/myfiles/file2.txt
no matter where you extract the tar.

Hope that makes makes it easier
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:09 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0