On 08/29/2012 09:49 AM, Peng Yu wrote:
> Hi,
> 
> I don't find a way to only cat a specific file (or a few specified
> files) in a .tar.gz. But I think that it is very likely that there is
> already a utility does so without having to extract the whole tar.gz.
> If anybody knows such a way, would you please let me know? Thanks!

tar -xOf file.tar.gz path/to/file/within/tar

(here, using GNU tar's ability to auto-detect a gzip-compressed tar
file, along with -O to output a specific file from within the tar to
stdout).

-- 
Eric Blake   [email protected]    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to