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

Re: search contents of a tar.gz



|> 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.

If you use emacs, you can just visit the compressed tar file and
operate on it like any directory-tree. For example, put FOO.tar.gz in
some directory DIR. Ctl-x d DIR to run dired (the directory editor) on
DIR, move the cursor to FOO.tar.gz and type f. The contents of the
tarball will be displayed in the dired buffer and you can operate on
the files as if they had been uncompressed and extracted from the
archive, even though they haven't.

Jim



Reply to: