AUGTOOL(1) Augeas AUGTOOL(1) NAME augtool - inspect and modify configuration files SYNOPSIS augtool [OPTIONS] [COMMAND] DESCRIPTION Augeas is a configuration editing tool. It parses configuration files in their native formats and transforms them into a tree. Configuration changes are made by manipulating this tree and saving it back into native config files. augtool provides a command line interface to the generated tree. COMMAND can be a single command as described under "COMMANDS". When called with no COMMAND, it reads commands from standard input until an end-of-file is encountered. OPTIONS -c, --typecheck Typecheck lenses. This can be very slow, and is therefore not done by default, but is highly recommended during development. -b, --backup When files are changed, preserve the originals in a file with extension '.augsave' -n, --new Save changes in files with extension '.augnew', do not modify the original files -r, --root=ROOT Use directory ROOT as the root of the filesystem. Takes precedence over a root set with the AUGEAS_ROOT environment variable. -I, --include=DIR Add DIR to the module loadpath. Can be given multiple times. The directories set here are 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. -t, --transform=XFM Add a file transform; uses the 'transform' command syntax, e.g. "-t 'Fstab incl /etc/fstab.bak'". -l, --load-file=FILE Load an individual FILE into the tree. The lens to use is determined automatically (based on autoload information in the lenses) and will be the same that is used for this file when the entire tree is loaded. The option can be specified multiple times to load several files, e.g. "-l /etc/fstab -l /etc/hosts". This lens implies "--noload" so that only the files specified with this option will be loaded. -f, --file=FILE Read commands from FILE. -i, --interactive Read commands from the terminal. When combined with -f or redirection of stdin, drop into an interactive session after executing the commands from the file. -e, --echo When reading commands from a file via stdin, echo the commands before printing their output. -s, --autosave Automatically save all changes at the end of the session. -S, --nostdinc Do not search any of the default directories for modules. When this option is set, only directories specified explicitly with -I or specified in AUGEAS_LENS_LIB will be searched for modules. -L, --noload Do not load any files on startup. This is generally used to fine- tune which files to load by modifying the entries in "/augeas/load" and then issuing a "load" command. -A, --noautoload Do not load any lens modules, and therefore no files, on startup. This creates no entries under "/augeas/load" whatsoever; to read any files, they need to be set up manually and loading must be initiated with a "load" command. Using this option gives the fastest startup. --span Load span positions for nodes in the tree, as they relate to the original file. Enables the use of the span command to retrieve position data. --timing After executing each command, print how long, in milliseconds, executing the command took. This makes it easier to spot slow queries, usually through match commands, and allows exploring alternative queries that yield the same result but might be faster. --version Print version information and exit. The version is also in the tree under "/augeas/version". COMMANDS In interactive mode, commands and paths can be completed by pressing "TAB". The paths accepted as arguments by commands use a small subset of XPath path expressions. A path expression consists of a number of segments, separated by "/". In each segment, the character "*" can be used to match every node regardless of its label. Sibling nodes with identical labels can be distinguished by appending "[N]" to their label to match the N-th sibling with such a label. The last sibling with a specific label can be reached as "[last()]". See "EXAMPLES" for some examples of this. ADMIN COMMANDS The following commands control the behavior of Augeas and augtool itself. help Print this help text load Load files according to the transforms in "/augeas/load". quit Exit the program retrieve Transform tree at PATH back into text using lens LENS and store the resulting string at NODE_OUT. Assume that the tree was initially read in with the same lens and the string stored at NODE_IN as input. save Save all pending changes to disk. Unless either the -b or -n command line options are given, files are changed in place. store Parse NODE using LENS and store the resulting tree at PATH. transform Add a transform for FILE using LENS. The LENS may be a module name or a full lens name. If a module name is given, then "lns" will be the lens assumed. The FILTER must be either "incl" or "excl". If the filter is "incl", the FILE will be parsed by the LENS. If the filter is "excl", the FILE will be excluded from the LENS. FILE may contain wildcards. load-file Load a specific FILE, automatically determining the proper lens from the information in /augeas/load; without further intervention, the lens that would oridnarily be used for this file will be used. READ COMMANDS The following commands are used to retrieve data from the Augeas tree. dump-xml [] Print entries in the tree as XML. If PATH is given, printing starts there, otherwise the whole tree is printed. get Print the value associated with PATH label Get and print the label associated with PATH ls List the direct children of PATH match [] Find all paths that match PATTERN. If VALUE is given, only the matching paths whose value equals VALUE are printed print [] Print entries in the tree. If PATH is given, printing starts there, otherwise the whole tree is printed span Print the name of the file from which the node PATH was generated, as well as information about the positions in the file corresponding to the label, the value, and the entire node. PATH must match exactly one node. You need to run 'set /augeas/span enable' prior to loading files to enable recording of span information. It is disabled by default. WRITE COMMANDS The following commands are used to modify the Augeas tree. clear Set the value for PATH to NULL. If PATH is not in the tree yet, it and all its ancestors will be created. clearm Clear multiple nodes values in one operation. Find or create a node matching SUB by interpreting SUB as a path expression relative to each node matching BASE. If SUB is '.', the nodes matching BASE will be modified. ins