[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to cat a specific file in .tar.gz?

From: Eric Blake
Subject: Re: How to cat a specific file in .tar.gz?
Date: Wed, 29 Aug 2012 15:35:20 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0

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

Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]