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 Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

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-19-2007 01:59 AM
untar to a specified file melanie_pfefer UNIX for Dummies Questions & Answers 3 11-27-2006 01:32 PM
Untar a TAR file at different location malaymaru UNIX for Dummies Questions & Answers 5 09-18-2006 08:59 PM
Urgent....untar!!! rahul26 UNIX for Advanced & Expert Users 4 06-12-2006 07:41 AM
Untar to different location pradeep_desh UNIX for Advanced & Expert Users 1 05-26-2006 11:05 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
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
Sponsored Links
  #2 (permalink)  
Old 09-07-2005
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,042
You could use pax:
pax -r -s '=^/opt/abc=/tmp=' < tarfile
Reply With Quote
  #3 (permalink)  
Old 09-08-2005
Ygor's Avatar
Ygor Ygor is offline Forum Staff  
Moderator
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,376
Or maybe chroot
Reply With Quote
  #4 (permalink)  
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

Bookmarks

Tags
None

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:




All times are GMT -4. The time now is 04:52 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66