unpacking one single file from archive

??? joe at openpower.com.tw
Fri Jan 21 01:30:41 UTC 2005


-----Original Message-----
From: redhat-list-bounces at redhat.com [mailto:redhat-list-bounces at redhat.com]On Behalf Of Paal Marker
Sent: Thursday, January 20, 2005 4:30 PM
To: General Red Hat Linux discussion list
Subject: Re: unpacking one single file from archive


C. Linus Hicks wrote:

>On Wed, 2005-01-19 at 07:04 -0600, Rigler, Stephen C. wrote:
>  
>
>>If the archive, "x.tar.gz", has a file that you want called "z.doc"
>>then if you only want to extract the one file do:
>>
>>tar xvzf x.tar.gz z.doc
>>    
>>
>
>This is true, AND you must match the path as stored in the archive. So
>for example, if you have an archive with:
>
>xyz/1.abc
>
>Then you must use:
>
>tar xf x.tar xyz/1.abc
>
>  
>
>Yes, that was where I missed it,  unpacking a file under home/user I did 
>it by habit writing  /home/user.....one slash to much.......thank u very 
>much.

>Another question is search for a file in a tar.gz archive.  Now I do it 
>in a heavy way in two steps, first make a file I can search in and then 
>make the search: 

>less y.tar.gz  |  cat >  readfile    
>grep -n "x.doc" readfile

>.......and I get the file with full path.

>I believe there is a command for searching directly for a file and path 
>in a tar.gz archive, but wich one is it?
You may try...
	tar ztvf  y.tar.gz |grep -i "x.doc"







-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list




More information about the redhat-list mailing list