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

Re: search contents of a tar.gz



On Tue, Sep 05, 2000 at 01:10:50PM +0900, Olaf Meeuwissen wrote:
> Brian Stults <bs7452@csc.albany.edu> writes:
> 
> > Is there a way to search the contents of a tar.gz file withouth having
> > to extract everything.  Specifically, I want to determine the disc-id of
> > an audio CD, so I downloaded the freedb database in tar.gz format.  Of
> > course, it's a very large file.  I would like to grep the contents to
> > find the CD that I'm looking for, but I don't want to extract
> > everything.  I thought there would be a series of piped commands that
> > would allow me to do it, but I can't figure it out.
> 
> tar -tzf file.tar.gz | grep something

Note that this requires processing the archive (including uncompressing
it), but that data need not be stored persistantly anywhere.  This
should fit the parameters of the request, but if the question is "can I
avoid decompression CPU overhead, the answer is "no".

-- 
Karsten M. Self <kmself@ix.netcom.com>     http://www.netcom.com/~kmself
 Evangelist, Opensales, Inc.                    http://www.opensales.org
  What part of "Gestalt" don't you understand?   Debian GNU/Linux rocks!
   http://gestalt-system.sourceforge.net/    K5: http://www.kuro5hin.org
GPG fingerprint: F932 8B25 5FDD 2528 D595 DC61 3847 889F 55F2 B9B0

Attachment: pgpoHv8PkfVB_.pgp
Description: PGP signature


Reply to: