ZIPGREP(1L)

πŸ“¦
version 6.0 Β· 3 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

πŸ’… ZIPGREP (1L) β€” ok so this is zipgrep, bestie

NAME

zipgrep β€” search the files inside a ZIP archive for lines that match a pattern πŸ¦‹


SYNOPSIS

zipgrep [egrep_options] pattern file[.zip] [file(s) ...]
[-x xfile(s) ...]

DESCRIPTION

okay so here's the vibe: zipgrep digs through the files inside a ZIP archive and hunts for lines that match the string or pattern you give it. πŸ”₯

Real talk though β€” zipgrep is a shell script, not some compiled binary, so it literally cannot function without egrep(1) and unzip(1L) doing the heavy lifting. And the output? Identical to what egrep(1) gives you. No cap, same energy. ✨


ARGUMENTS

  • pattern β€” the thing you're looking for inside the ZIP archive. Any string or regular expression that egrep(1) accepts is fair game, so go off. πŸ’…
  • file[.zip] β€” the path of the ZIP archive. Heads up though: wildcard expressions for the ZIP archive name are not supported, so don't try it. πŸ™ˆ If the literal filename isn't found, the suffix .zip gets appended for you β€” cute, right? And self-extracting ZIP files work just like any other ZIP archive; you just have to specify the .exe suffix (if there is one) explicitly.
  • [file(s)] β€” an optional list of archive members to process, separated by spaces. Skip this and all members of the ZIP archive get searched. πŸŽ€ You can use regular expressions (wildcards) to match multiple members:
    • * β€” matches a sequence of 0 or more characters
    • ? β€” matches exactly 1 character
    • [...] β€” matches any single character found inside the brackets; ranges are specified by a beginning character, a hyphen, and an ending character. If an exclamation point or a caret (! or ^) follows the left bracket, then the range of characters within the brackets is complemented (that is, anything except the characters inside the brackets is considered a match).
Be sure to quote any character that might otherwise be interpreted or modified by the operating system. Like, fr fr, quote it or the shell will eat it. 😭
  • [-x xfile(s)] β€” an optional list of archive members to exclude from processing. This one's iconic because wildcard characters match directory separators (/), which means you can use it to exclude any files that are in subdirectories. For example, zipgrep grumpy foo *.[ch] -x */* would search for the string grumpy in all C source files in the main directory of the foo archive, but none in any subdirectories. Without the -x option, all C source files in all directories within the zipfile would be searched. 🫢

✨ OPTIONS ✨

All options prior to the ZIP archive filename are passed to egrep(1). That's it. That's the whole rule. πŸ‘‘


SEE ALSO

egrep(1), unzip(1L), zip(1L), funzip(1L), zipcloak(1L), zipinfo(1L), zipnote(1L), zipsplit(1L) β€” the whole friend group 🧚


URL

The Info-ZIP home page is currently at

http://www.info-zip.org/pub/infozip/

or

ftp://ftp.info-zip.org/pub/infozip/

AUTHORS

zipgrep was written by Jean-loup Gailly. πŸ‘‘ main character energy


okay that's the whole page, ily, go grep something πŸ’–

this was brought to you by Info-ZIP, dated 20 April 2009, and yeah the page is literally called ZIPGREP(1L) β€” slay 🌈