Operating System - HP-UX
1832100 Members
3175 Online
110038 Solutions
New Discussion

Question about UN-TAR files into different path

 
Kenneth Leung_2
Frequent Advisor

Question about UN-TAR files into different path

I performed a tar with absolute path as below:

#tar -cvpf /tmp/a.tar /opt/sybase

Now I want to untar a.tar & extract the files into /opt/testing instead of /opt/sybase. Can anyone show me how to do it? Thanks a lot.
4 REPLIES 4
Steven Schweda
Honored Contributor

Re: Question about UN-TAR files into different path

Now you (should) know why not to use an
absolute path with "tar".

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1065980
Vibhor Kumar Agarwal
Esteemed Contributor

Re: Question about UN-TAR files into different path

I think Gnu tar has the option to override the absolute paths.
Vibhor Kumar Agarwal
Peter Godron
Honored Contributor

Re: Question about UN-TAR files into different path

Yogeeraj_1
Honored Contributor

Re: Question about UN-TAR files into different path

hi,

try:

cd /opt/sybase/
tar -cvpf /tmp/a.tar .

then
mkdir /opt/testing
cd /opt/testing/
tar -xvf /tmp/a.tar


also have a look at the pax command.

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)