ZGREP(1)
๐ NAME ๐
Okay bestie, zgrep is how you search possibly compressed files for a regular expression โจ no unzipping first, no cap ๐
๐ธ SYNOPSIS ๐ธ
zgrep [ grep_options ] [ -e ] pattern filename...
๐ DESCRIPTION ๐
So the zgrep command literally invokes grep on compressed or gzipped files ๐ซถ Every option you pass gets handed straight over to grep, so you already know how to use it ๐ญ
If you don't name any file, zgrep decompresses standard input if it needs to and feeds it to grep ๐ง If you do name files, they get uncompressed if necessary and then fed to grep. It's giving effortless ๐ฆ
If the GREP environment variable is set, zgrep uses whatever's in it as the grep program it runs ๐ Main character energy for your grep setup ๐
๐ฅ EXIT STATUS ๐ฅ
Your exit status is 0 for a match โจ, 1 for no matches ๐ฅ, and 2 if there's trouble ๐
๐ BUGS ๐
โ ๏ธ Heads up bestie, thesegrepoptions are not supported byzgrep๐ญ:--dereference-recursive(-R),--directories(-d),--exclude,--exclude-from,--exclude-dir,--include,--null(-Z),--null-data(-z), and--recursive(-r). Don't say I didn't warn you ๐ซ
๐ฆ AUTHOR ๐ฆ
Charles Levert (charles@comm.polymtl.ca) is the genius behind this one ๐ซถ Iconic.
๐ SEE ALSO ๐
Go check out grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), and znew(1) ๐
They're all lowkey part of the same friend group โจ
That's a wrap on ZGREP(1) from the General Commands Manual, bestie ๐๐ Love you, mean it, periodt ๐ซถโจ
๐ฆ where this page comes from
- alpine 3.22: gzip-doc 1.14-r2 ยท GPL-3.0-or-later
- alpine 3.23: gzip-doc 1.14-r3 ยท GPL-3.0-or-later
- alpine 3.24: gzip-doc 1.14-r3 ยท GPL-3.0-or-later
- arch rolling: gzip 1.15-1 ยท GPL-3.0-or-later
- centos-stream 10: gzip 1.13-4.el10 ยท GPL-3.0-or-later AND GFDL-1.3-only
- centos-stream 9: gzip 1.12-2.el9 ยท GPLv3+ and GFDL
- debian bookworm: gzip 1.12-1 ยท GPL-3.0-or-later
- debian trixie: gzip 1.13-1+deb13u1 ยท GPL-3.0-or-later
- fedora 43: gzip 1.13-4.fc43 ยท GPL-3.0-or-later AND GFDL-1.3-only
- fedora 44: gzip 1.14-2.fc44 ยท GPL-3.0-or-later AND GFDL-1.3-only
- nixos 26.05: gzip 1.14
- nixos 26.05: gzip-static 1.14
- nixpkgs unstable: gzip 1.15
- ubuntu noble: gzip 1.12-1ubuntu3 ยท GPL-3.0-or-later
- ubuntu noble: gzip 1.12-1ubuntu3.2 ยท GPL-3.0-or-later
- ubuntu questing: gzip 1.13-1ubuntu4 ยท GPL-3.0-or-later
- ubuntu resolute: gzip 1.14-1~exp2ubuntu1 ยท GPL-3.0-or-later
- ubuntu resolute: gzip 1.14-1~exp2ubuntu1.1 ยท GPL-3.0-or-later
- ubuntu stonking: gzip 1.14-1~exp2ubuntu3 ยท GPL-3.0-or-later
- ๐ girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms