AUGMATCH(1)

πŸ’… augmatch(1) β€” the Augeas girlie's field guide

ok so you found the augmatch(1) page in the Augeas manual and you're like "bestie what is this" β€” don't worry, I got you. Sit down, hydrate, and let's get into it. 🫢


✨ NAME ✨

augmatch β€” inspect and match contents of configuration files. that's it, that's the vibe. πŸ”


🌸 SYNOPSIS 🌸

augmatch [OPTIONS] FILE

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so augmatch prints out the tree that Augeas generates when it parses a configuration file. or β€” and this is the fun part β€” it prints just the parts of that tree that match a certain path expression. iykyk. πŸ’…

the parsing itself is controlled by lenses, and a whole bunch of them ship with Augeas already. augmatch will try to select the correct lens for a given file automatically, unless you specifically hand it one with the --lens option. main character energy: it figures it out on its own, but it will absolutely let you pick. ✨


πŸŽ€ OPTIONS πŸŽ€

  • -a, --all β€” print all the tree nodes, even the ones with no associated value. without this flag, augmatch leaves those nodes out of the output because honestly they're usually not that interesting. πŸ’€
  • -e, --exact β€” only print the parts of the tree that exactly match the expression you gave with --match, and none of the descendants of the matching nodes. strictly the matched node, no plus-ones. πŸ™…
  • -I, --include=DIR β€” add DIR to the module loadpath. you can give this multiple times (-I is a repeater, she's flexible πŸ’–). the directories you set here get searched before any directories specified in the AUGEAS_LENS_LIB environment variable, and before the default directories /usr/share/augeas/lenses and `/usr/share/augeas/lenses/dist.
  • -l, --lens=LENS β€” use LENS for the given file. without this option, augmatch tries to guess the lens for the file based on the file's name and path β€” which only works for files in standard locations. non-standard path? yeah, you're gonna need this flag. 😭
  • -L, --print-lens β€” print the name of the lens that will be used with the given file, and exit. just the gossip, no tree. πŸ‘‘
  • -m, --match=EXPR β€” only print the parts of the tree that match the path expression EXPR. all nodes that match EXPR and their descendants get printed. use --exact if you want only the matching nodes and not the descendants. 🌈
  • -r, --root=ROOT β€” use directory ROOT as the root of the filesystem. this takes precedence over a root set with the AUGEAS_ROOT environment variable. root over root, periodt.
  • -S, --nostdinc β€” do not search any of the default directories for lenses. when this is set, only directories specified explicitly with -I or specified in AUGEAS_LENS_LIB will be searched for modules. no defaults, no surprises. 🚫
  • -o, --only-value β€” print only the value, and not the label or the path of nodes. minimalism slay. πŸ’…
  • -q, --quiet β€” do not print anything. exit with zero status if a match was found. silent but useful, the introvert icon. 🀫

🧚 ENVIRONMENT VARIABLES 🧚

  • AUGEAS_ROOT β€” the file system root, defaults to /. can be overridden with the -r command line option.
  • AUGEAS_LENS_LIB β€” colon separated list of directories with lenses. directories specified here are searched after any directories set with the -I command line option, but before the default directories /usr/share/augeas/lenses and `/usr/share/augeas/lenses/dist.
order matters here bestie, lowkey the whole search order is: -I dirs β†’ AUGEAS_LENS_LIB dirs β†’ the defaults. don't forget it. 🫢

⭐ EXAMPLES ⭐

# print the tree for /etc/exports
augmatch /etc/exports

# show only the entry for a specific mount
augmatch -m 'dir["/home"]' /etc/exports

# show all the clients to which we are exporting /home
augmatch -eom 'dir["/home"]/client' /etc/exports

look at that third one β€” -eom, three flags stacked like a little charm bracelet. ate. πŸ”₯


πŸ“ EXIT STATUS πŸ“

  • the exit status is 0 when there was at least one match πŸ’–
  • 1 if there was no match 😭
  • 2 if an error occurred πŸ’€

🌈 FILES 🌈

lenses and schema definitions live in /usr/share/augeas/lenses and `/usr/share/augeas/lenses/dist


πŸ’œ AUTHOR πŸ’œ

David Lutterkort <lutter@watzmann.net> β€” the icon who made this all happen. πŸ‘‘


Copyright 2007-2018 David Lutterkort

Augeas (and augmatch) are distributed under the GNU Lesser General Public License (LGPL).


πŸ” SEE ALSO πŸ”


okay that's the whole page, you're basically an Augeas expert now, no cap. go match some trees. 🌸

Augeas 1.15.0 Β· 2026-09-29 β€” mwah, that's the version and the date, and that's the whole AUGMATCH(1) page. bye bestie! πŸ’…βœ¨

πŸ“¦ where this page comes from