Author Topic: *nix (Solaris) tar  (Read 1650 times)

*nix (Solaris) tar
« on: 06 November, 2009, 11:23:23 am »
I have a tarfile which contains some files. It's been built with absolute pathnames, /cms/dir1/dir2/file when I extract the contents using tar xvf tarfile it fails because I think it is unable to create /cms on my system. I don't have privilege to create files there anyway.

Is there a means of extracting the files to the current directory and ignore their paths ?

Re: *nix (Solaris) tar
« Reply #1 on: 06 November, 2009, 11:32:06 am »
a) find/use gnu's version of tar (you can find it on sunfreeware.com but if you don't have root you won't be able to install it)

b) Use a Linux machine which has gnu tar on it and will strip the leading / for you.

c) Use chroot and the statically compiled version of tar:-

/usr/bin/cp /usr/sbin/static/tar /tmp
/usr/bin/dd if=foo.tar | /usr/bin/chroot /tmp ./tar xf -

That'll unpack it into /tmp for you
"Yes please" said Squirrel "biscuits are our favourite things."

Re: *nix (Solaris) tar
« Reply #2 on: 06 November, 2009, 11:44:57 am »
...


b) Use a Linux machine which has gnu tar on it and will strip the leading / for you.

...

 :thumbsup:

thx