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 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 02: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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-07-2005
handak9 handak9 is offline
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.
  #2 (permalink)  
Old 09-07-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,100
You could use pax:
pax -r -s '=^/opt/abc=/tmp=' < tarfile
  #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,402
Or maybe chroot
  #4 (permalink)  
Old 09-09-2005
Unbeliever Unbeliever is offline
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.
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 11:11 PM.


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