Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!gatech!purdue!mentor.cc.purdue.edu!mjs From: mjs@mentor.cc.purdue.edu (Mike Spitzer) Newsgroups: comp.unix.questions Subject: Re: extracting tar files with absolute pathnames relatively Keywords: tar pathname Message-ID: <2495@mentor.cc.purdue.edu> Date: 21 Apr 89 01:30:23 GMT References: <1501@cfa205.cfa250.harvard.edu> Reply-To: mjs@mentor.cc.purdue.edu (Mike Spitzer) Organization: Purdue University Lines: 24 In article <1501@cfa205.cfa250.harvard.edu> todd@cfa250.harvard.edu (Todd Karakashian) writes: >I am in posession of tapes containing tarfiles with absolute >pathnames. What I would like to do is to extract these files into a >different tree structure than they were tarred from. Thus, the >tarfile /usr/foo/file should go into the disk pathname /temp/file. I >have been unable to find a way to do this -- does anyone know how? > >I am running SunOS 3.5. I apologize if this is too simple a question. Without modifying tar, the easiest was to accomplish this is to use chroot. Lucky for you, SunOS (at least 4.0... I think that 3.? had this too) has a chroot(8) command. Try something like this (you'll have to be root): mkdir /tmp/newroot cp tarfile /tmp/newroot chroot /tmp/newroot tar xf /tarfile If you don't have the chroot program, it's pretty simple to write. See the chroot(2) man page for more information. -- Michael J. Spitzer Purdue University Computing Center mjs@mentor.cc.purdue.edu pur-ee!mentor.cc.purdue.edu!mjs