1833796 Members
4872 Online
110063 Solutions
New Discussion

untar

 
SOLVED
Go to solution
Michael_33
Regular Advisor

untar

i have a tar ball, now i want to untar to a
new directory, i.e all files will be extract into /123, how to do it?

high score
5 REPLIES 5
Michael_33
Regular Advisor

Re: untar

i knew the answer, close.
T G Manikandan
Honored Contributor
Solution

Re: untar

Joseph Loo
Honored Contributor

Re: untar

hi,

copy the tar ball, e.g. abc.tar, to /123

# cd /123
# tar xvf abc.tar
to explode the tar file to that directory

regards.
what you do not see does not mean you should not believe
Naveej.K.A
Honored Contributor

Re: untar

How did you back this up??

What does tar tvf /dev/rmt/0m shows??

(only first 2 or 3 lines required)

Anyway try this,

cd 123
pax -rv -s'/^\///' < /dev/rmt/0m

Regards,
naveej

practice makes a man perfect!!!
C. Beerse_1
Regular Advisor

Re: untar

If the tar ball has relative paths used, just step into the new directory and untar. If needed move the files from subdirectories to their target place.

If the tar ball has absolute paths used, use gnu-tar (for example from the porting archive: http://hpux.its.tudelft.nl/hppd/hpux/Gnu/tar-1.15/) That can change absolute paths on extraction.

If you need to stick to what you have, you can setup a tiny `chroot` jail and extract to that: `mkdir /path/to/target`, copy needed binaries and the tar-file in there and `chroot` into there to untar.
make everything as simple as possible, not simpler (A.Einstein??)