Page 1 of 1

grepping stacks of gzip file - zgrep?

Posted: 2020/06/22 20:56:12
by sawozny
Greeting, Gurus! :)

I need to grep a stack of files in a directory tree but the files are gzip'ed so I'm looking for recommendation on how to do that. Unzipping, grepping and rezipping afterwards in a script sounds like a huge PITA...

I found mentions of zgrep online, but I can't see it (or the zutils package it's supposed to be part of) in any of the standard repos so before I head down the path of compiling it from source, I thought I'd ask if anyone here has an easier way to do this.

Thanks,

Scott

Re: grepping stacks of gzip file - zgrep?

Posted: 2020/06/22 22:18:01
by TrevorH
zgrep is a standard utility installed as part of CentOS - it's part of the gzip package.

Re: grepping stacks of gzip file - zgrep?

Posted: 2020/06/23 17:47:41
by sawozny
TrevorH wrote:
2020/06/22 22:18:01
zgrep is a standard utility installed as part of CentOS - it's part of the gzip package.
I swear the first thing I did when I heard about zgrep was try to use it and I got a "command not found" back. Checked again when you said it was installed by default and there it is! Must have fat fingered it the first time. Thanks for the assist on my ID-TEN-T problem. <hangs head in shame> :)

Scott