[SunHELP] extract tar file in the current directory?

Richard Russell richard.russell at db.com
Wed Nov 24 03:47:21 CST 2004


I happenned to be reading this page the other day: 
http://www.columbia.edu/~rtt2101/iaoq/#I.A1

How do I untar a file with absolute paths to a relative location? 
a.      Method 1 (user) 
1.      /usr/bin/pax -r -s ',^/,,' -f file.tar 
b.      Method 2 (root) 
1.      /usr/bin/cp /usr/sbin/static/tar /tmp 
2.      /usr/bin/dd if=file.tar | /usr/bin/chroot /tmp ./tar xf - 

Cheers

Richard Russell 
Deutsche Bank AG London 
Global Markets Customer Solutions
Office: +44 (0)20 7545 8060
Mobile: +44 (0)79 0661 2237




ert weerr <sun1sol at yahoo.com>
Sent by: sunhelp-bounces at sunhelp.org
11/24/2004 06:32 AM
Please respond to The SunHELP List
 
        To:     SunHelp <sunhelp at sunhelp.org>
        cc: 
        Subject:        [SunHELP] extract tar file in the current 
directory?


Guys,

I have a tar file what I want to extract in a
temporary directory.
The problem is that the tarball has been created
by using the full-paths...

/opt/package/stat.cfg
/opt/package/info.cfg

If I'd extract it in /tmp than it still overwrote
the original files in /opt/package...
So, I don't want it to overwrite the files in the
original directory with the backup ones.

Can I force tar to extract the files in the /tmp
directory?

Thanks in advance!

Regards,

John


 
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - Get yours free! 
http://my.yahoo.com 
 
_______________________________________________
SunHELP maillist  -  SunHELP at sunhelp.org
http://www.sunhelp.org/mailman/listinfo/sunhelp



More information about the SunHELP mailing list