The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
untar prakash96453 UNIX for Advanced & Expert Users 2 10-18-2007 10:59 PM
untar to a specified file melanie_pfefer UNIX for Dummies Questions & Answers 3 11-27-2006 11:32 AM
Untar a TAR file at different location malaymaru UNIX for Dummies Questions & Answers 5 09-18-2006 05:59 PM
Urgent....untar!!! rahul26 UNIX for Advanced & Expert Users 4 06-12-2006 04:41 AM
Untar to different location pradeep_desh UNIX for Advanced & Expert Users 1 05-26-2006 08:05 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 09-07-2005
Registered User
 

Join Date: Jul 2004
Posts: 31
Untar to different location

I have a tar file where the files have been tar'd along with the location of the file i.e

/opt/abc/file.txt
/opt/abc/file2.txt

I am trying to untar this file on a different server where /opt/abc does not exist.

How do I untar these files without the tar trying to create the structure /opt/abc??

I really need to do this without the /opt/abc location being created on my server.
Reply With Quote
Forum Sponsor
  #2  
Old 09-07-2005
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
You could use pax:
pax -r -s '=^/opt/abc=/tmp=' < tarfile
Reply With Quote
  #3  
Old 09-08-2005
Ygor's Avatar
Moderator
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,249
Or maybe chroot
Reply With Quote
  #4  
Old 09-09-2005
Registered User
 

Join Date: Jul 2005
Location: England
Posts: 183
You could install GNU tar from www.sunfreeware.com as that strips leading slashes form pathnames by default.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:06 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0