grepping stacks of gzip file - zgrep?

General support questions
Post Reply
sawozny
Posts: 40
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
Forum Moderator
Posts: 29077
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.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

sawozny
Posts: 40
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

Return to “CentOS 7 - General Support”