DGLOB(1)
π DGLOB(1) β the Debian-goodies glow-up π
okay bestie, pull up a chair, because dglob is one of those little tools that's lowkey iconic and nobody talks about it enough. it lives in the Debian-goodies family (that's the manual section it's filed under, iykyk) and it's about to become your new fave. β¨
β¨ NAME β¨
dglob β expand package names or files matching a pattern π
πΈ SYNOPSIS πΈ
dglob [-a] pattern
dglob [-0] -f pattern
π¦ DESCRIPTION π¦
so basically: dglob lists package names that match a substring pattern. that's the whole vibe. and if you want, it can also list all the files those packages contain. it's giving "find but for packages." π
by default dglob only searches installed packages β like, the ones actually on your machine. the -a and -n switches widen that search (scroll down to OPTIONS, bestie, i got you). the list gets written to stdout, one name per line. clean. tidy. slay.
grep-dctrl(1) and grep-aptavail(1) are the ones doing the actual searching through the package list, so if you wanna know exactly how patterns get matched, go read their docs. no cap. by default, every package whose name contains the string you gave gets matched β but there's a whole lil arsenal of options to change that behavior (again: OPTIONS). π«Ά
now, if you use dglob with the -f option, instead of package names you get all the files inside the matched packages. and here's the important part, don't skip it:
- if you do NOT use the
-aswitch, only existing, plain files get listed β meaning no symlinks, no directories, no other special file types. just plain ones. π - if you do use the
-aswitch, then all files get listed, both for installed and non-installed packages.
the filenames go to stdout, one file per line. and if you want them separated by '\0' instead of a newline? that's what the -0 option is for. π
π OPTIONS π
dglob supports the following options β every single one, no skips:
-aβ search through all available packages, not just the installed ones. if this is set,grep-aptavail(1)gets used. π-Aβ do not emit architecture qualifiers on the result. bye bye:amd64, basically.-nβ search through all the available packages but not including the installed ones. if set,grep-aptavail(1)is used. (yes it's the "everything except what i already have" girlie.)-fβ list all files in the matched packages. by default this only lists installed (i.e. locally existing) files from installed packages. if you use it together with-a, then it lists all files β both from installed and non-installed packages β by means ofapt-file(1).
β οΈ real talk: ifapt-fileisn't installed, then using-ftogether with-ais, and i quote, "rather pointless." so maybe install it first, bestie. π
-0β when listing files (with-f), use'\0'as the separator instead of a newline. and when you specify this without-f? it does absolutely nothing. zero. nada. it's just vibing there. π-r,-e,-i,-X,-vβ these get passed directly togrep-dctrl(1)or togrep-aptavail(1)to modify how the pattern is matched. seegrep-dctrl(1)for the deets. β¨
π₯ EXAMPLES π₯
okay this is the part where it all clicks. watch:
$ dglob libc6
libc6-dbg:amd64
libc6:amd64
libc6:i386
libc6-i386:amd64
libc6-dev:amd64
see how it just knew? next:
$ dglob libc6:amd64
libc6-dbg:amd64
libc6:amd64
libc6-i386:amd64
libc6-dev:amd64
and with the :all architecture qualifier, iconic behavior:
$ dglob zsh:all
zsh-syntax-highlighting:all
zsh-theme-powerlevel9k:all
zsh-doc:all
zsh-common:all
zsh-antigen:all
fizsh:all
now the -n girlie β everything except installed:
$ dglob -n libc6:i386
libc6-amd64-dbgsym:i386
libc6-amd64:i386
libc6-dbg:i386
libc6-dev-amd64:i386
libc6-dev-x32:i386
libc6-dev:i386
libc6-pic:i386
libc6-x32-dbgsym:i386
libc6-x32:i386
libc6-xen:i386
and finally, -a piped into wc -l because we love counting our blessings (and our packages):
$ dglob -a :amd64 | wc -l
45846
$ dglob -a :i386 | wc -l
45185
$ dglob -a :all | wc -l
28995
numbers. gorgeous. π
π FILES π
/var/lib/dpkg/statusβ thedpkg(8)status file, which serves as the source for the list of available and installed packages. it's literally the main character of this whole operation. π
π AUTHORS π
- Matt Zimmerman
<mdz@debian.org> - Axel Beckert
<abe@debian.org>
this manpage was written by Frank Lichtenheld <frank@lichtenheld.de>, and further enhanced by Javier Fernandez-Sanguino <jfs@debian.org>. absolute legends, all of them. π«Ά
β COPYRIGHT AND LICENCE β
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 π
grep-dctrl(1), grep-available(1), apt-file(1), dpkg(8)
and that's the tea, bestie π this page came to you courtesy of perl v5.40.1 and the date 2025-12-06 β go forth and glob, you absolute icon. πβ¨π¦
π¦ where this page comes from
- ubuntu resolute: debian-goodies 0.88.2ubuntu2 Β· GPL-2.0-or-later
- ubuntu stonking: debian-goodies 0.88.2ubuntu2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms