DPKG-AWK(1)

✨ DPKG-AWK(1) ✨

okay bestie, so this is a page from the General Commands Manual β€” it's the Debian Utilities era, and honestly? she's giving vintage but make it useful. sit down, grab a boba πŸ§‹, and let's talk about dpkg-awk. πŸ’…


🌸 NAME 🌸

dpkg-awk β€” a little utility that reads a dpkg-style db file, no cap πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

dpkg-awk [(-f|--file) filename] [(-d|--debug) ##] [(-s|--sort) list]
[(-rs|--rec_sep) ??] '<fieldname>:<regex>' ... -- <out_fieldname> ..

πŸ’– DESCRIPTION πŸ’–

so dpkg-awk parses a dpkg status file (or literally any other file formatted the same way) and spits out the resulting records for you. that's it, that's the vibe.

the way it works is: you can throw regex at the field values to narrow down which records come back, you can tell it exactly which fields to output, and you can even sort the matched fields. lowkey powerful. highkey underrated. 🫢


✨ OPTIONS ✨

  • -f filename, --file filename β€” the file you want her to parse. if you don't say anything, she defaults to /var/lib/dpkg/status. iconic default behavior honestly.
  • -d [#], --debug [#] β€” every single time you specify this one, the debug level goes up. stack it like it's a combo multiplier πŸ”₯
  • -s field(s), --sort field(s) β€” a space or comma separated list of fields to sort on. space or comma, she's flexible like that.
  • -n field(s), --numeric field(s) β€” a space or comma separated list of fields that should be interpreted as numeric in value. so like, actual numbers, not just pretty number-looking strings. πŸ”’
  • -rs ??, --rec_sep ?? β€” output this string at the end of each output paragraph. your little record separator moment. πŸŽ€
  • -h, --help β€” displays some help. go off, queen.
  • fieldname β€” these are the fields from the file that get matched against the regex you gave. bestie, listen: the fieldnames are case insensitive. πŸ™Œ
  • out_fieldname β€” these are the fields from the file that get output for each record. and here's the plot twist: if the first field listed begins with ^, then the list of fields that follows will NOT be output. got it? the caret is a little "nope, invert it" gremlin. πŸ™ˆ

πŸ’€ BUGS πŸ’€

okay so, be warned: the author only has a shallow understanding of the dpkg packaging system. so there are probably tons of bugs in this program. like, tons. she said it herself, I'm just the messenger. 😭

this program comes with no warranties. and fr fr, if running this program causes fire and brimstone to rain down upon the earth, you will be on your own. like, genuinely, that's on you. πŸ”₯🌧️

also, this program accesses the dpkg database directly in places, querying for data that cannot be gotten via dpkg. so yeah, she's going straight to the source. no middleman. πŸ’…


πŸ‘‘ AUTHOR πŸ‘‘

Adam Heath <doogie@debian.org> β€” thank you for your service, king 🫑


and that's the whole page, bestie!! this one came from the DEBIAN distribution, in the Debian Utilities section, and it's DPKG-AWK(1) β€” so you know exactly where to find her again. mwah, go parse something πŸ’‹βœ¨

πŸ“¦ where this page comes from