View Single Post

   
  #3 (permalink)  
Old 01-16-2008, 08:37 AM
K7MEM
 
Posts: n/a
Default Re: tar extraction of file at root directory

melissa_benkyo wrote:
> hello all,
>
> Good morning! I'm having a problem with tar extraction. I have a tar
> file that contains the following
>
> /abc/file1.txt
> /def/file2.txt
>
> and I want to extract the files but it doesn't allow me to since this
> would be extracting in the root directory and that directory hasn't
> been created yet. Is it possible to just extract the files? and put
> them in a separate directory override what is on the tar file?
>
> thanks!
>
> melissa


That is a common problem when the original tar file/tape was created
incorrectly. What you have is a "rooted" tar that was created by
specifying full paths to the files. It should have been created as
a "unrooted" tar where the extraction could be local to your
current directory.

You can, as someone else mentioned, use gnu tar. They have a option
for doing what you want to do.

Or have a system administrator insert a couple of links in the root
directory for you. Have them point to where you want the data to
wind up. When your done, let them know and they can delete the
links.

--
Martin E. Meserve
k7mem@myrealbox.com
http://www.k7mem.150m.com

Reply With Quote