ZGREP(1)

๐Ÿ“ฆ
version 1.15 ยท 10 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

๐ŸŽ€ 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, these grep options are not supported by zgrep ๐Ÿ˜ญ: --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 ๐Ÿซถโœจ