View Single Post

   
  #4 (permalink)  
Old 01-16-2008, 07:37 AM
Scott Howard
 
Posts: n/a
Default Re: tar extraction of file at root directory

melissa_benkyo <wyl_lyf@yahoo.com> 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


Use pax :
pax -r -s'/^\///' -f myfile.tar

This will restore the tar file into the current directory with any
reading /'s removed, so /abc/file1.txt will become simply abc/file.txt

Scott
Reply With Quote