grepping stacks of gzip file - zgrep?

General support questions
Post Reply
sawozny
Posts: 48
Joined: 2019/07/13 22:19:14

grepping stacks of gzip file - zgrep?

Post by sawozny » 2020/06/22 20:56:12

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

User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: grepping stacks of gzip file - zgrep?

Post by TrevorH » 2020/06/22 22:18:01

zgrep is a standard utility installed as part of CentOS - it's part of the gzip package.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

sawozny
Posts: 48
Joined: 2019/07/13 22:19:14

Re: grepping stacks of gzip file - zgrep?

Post by sawozny » 2020/06/23 17:47:41

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

Post Reply