DGREP(1)

πŸ’– DGREP πŸ’–

okay bestie, welcome to dgrep β€” part of the Debian-goodies docs (that's the manual page you're holding, section 1). she's a lil shell script with main character energy and she's about to make your life SO much easier. grab a boba, sit down, let's go 🫢


✨ NAME ✨

dgrep, degrep, dfgrep, dzgrep β€” grep through files belonging to an installed Debian package. no cap, that's literally her whole job πŸ’…


🌸 SYNOPSIS 🌸

dgrep [most grep options] pattern package...

dgrep --help

like. pattern first, then the package(s). simple as that ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea β˜• β€” dgrep invokes grep(1) on every single file in one or more installed Debian packages. every one. she's thorough like that.

the way she does it: she passes the package argument(s) over to dglob(1) to get a list of the files in those packages. and for matching the package names themselves, she uses dglob's substring pattern matching β€” so you don't even gotta type the full name, iykyk πŸ‘‘

and HERE'S the cute part πŸŽ€ β€” if you invoke dgrep under a different name, she switches up her whole vibe:

  • as degrep β†’ she uses grep(1) with the -E option instead πŸ”₯
  • as dfgrep β†’ grep(1) with the -F option, respectfully
  • as dzgrep β†’ the command zgrep(1) is used instead of grep(1)

(and the "etc." is doing a lot of heavy lifting there, so just know the pattern holds ✨)


πŸ‘‘ OPTIONS πŸ‘‘

dgrep supports most of grep(1)'s options. like, the majority. please go check your grep(1) documentation (the manpage OR the texinfo manual, either one bestie) for a complete listing, because we're not reprinting the whole thing here πŸ’€

only a FEW options are excluded, and that's because they don't conform with the intended behaviour. see the list below πŸ‘‡

πŸ™ˆ Options of grep that are not supported by dgrep πŸ™ˆ

  • -r, --recursive, -d recurse, --directories=recurse β€” nope, not supported 🚫
  • -d read, --directories=read β€” also not supported, sorry babe

so why?? okay so dgrep searches only in the "normal" files of a package. she skips all directories and symlinks. every single one. so obviously the options of grep that are specific to directories just... don't apply? they'd be giving nothing. hence: not supported πŸ’…

lowkey important: if you came here expecting recursion, she's not gonna do it. she said what she said πŸŽ€

πŸ’œ AUTHOR πŸ’œ

  • Matt Zimmerman <mdz@debian.org> β€” the original icon πŸ‘‘
  • This manpage was written by Frank Lichtenheld <frank@lichtenheld.de> ✍️

Copyright (C) 2001 Matt Zimmerman <mdz@debian.org>.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.

On Debian systems, a copy of the GNU General Public License version 2 can be found in /usr/share/common-licenses/GPL-2.


⭐ SEE ALSO ⭐


and that's the whole page bestie, you ate that πŸ“βœ¨ this one came to you courtesy of perl v5.40.1, dated 2025-12-06 β€” mwah, go grep something iconic πŸ’–πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from