=head1 NAME augtool - inspect and modify configuration files =head1 SYNOPSIS augtool [OPTIONS] [COMMAND] =head1 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 L. When called with no COMMAND, it reads commands from standard input until an end-of-file is encountered. =head1 OPTIONS =over 4 =item B<-c>, B<--typecheck> Typecheck lenses. This can be very slow, and is therefore not done by default, but is highly recommended during development. =item B<-b>, B<--backup> When files are changed, preserve the originals in a file with extension '.augsave' =item B<-n>, B<--new> Save changes in files with extension '.augnew', do not modify the original files =item B<-r>, B<--root>=I Use directory ROOT as the root of the filesystem. Takes precedence over a root set with the AUGEAS_ROOT environment variable. =item B<-I>, B<--include>=I 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 F and F. =item B<-t>, B<--transform>=I Add a file transform; uses the 'transform' command syntax, e.g. C<-t 'Fstab incl /etc/fstab.bak'>. =item B<-l>, B<--load-file>=I 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. C<-l /etc/fstab -l /etc/hosts>. This lens implies C<--noload> so that only the files specified with this option will be loaded. =item B<-f>, B<--file>=I Read commands from FILE. =item B<-i>, B<--interactive> Read commands from the terminal. When combined with B<-f> or redirection of stdin, drop into an interactive session after executing the commands from the file. =item B<-e>, B<--echo> When reading commands from a file via stdin, echo the commands before printing their output. =item B<-s>, B<--autosave> Automatically save all changes at the end of the session. =item B<-S>, B<--nostdinc> Do not search any of the default directories for modules. When this option is set, only directories specified explicitly with B<-I> or specified in B will be searched for modules. =item B<-L>, B<--noload> Do not load any files on startup. This is generally used to fine-tune which files to load by modifying the entries in C and then issuing a C command. =item B<-A>, B<--noautoload> Do not load any lens modules, and therefore no files, on startup. This creates no entries under C whatsoever; to read any files, they need to be set up manually and loading must be initiated with a C command. Using this option gives the fastest startup. =item B<--span> Load span positions for nodes in the tree, as they relate to the original file. Enables the use of the B command to retrieve position data. =item B<--timing> After executing each command, print how long, in milliseconds, executing the command took. This makes it easier to spot slow queries, usually through B commands, and allows exploring alternative queries that yield the same result but might be faster. =item B<--version> Print version information and exit. The version is also in the tree under C. =back =head1 COMMANDS In interactive mode, commands and paths can be completed by pressing C. 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 C. In each segment, the character C<*> can be used to match every node regardless of its label. Sibling nodes with identical labels can be distinguished by appending C<[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 C<[last()]>. See L for some examples of this. =head2 ADMIN COMMANDS The following commands control the behavior of Augeas and augtool itself. =over 4 =item B Print this help text =item B Load files according to the transforms in C. =item B Exit the program =item B ELENSE ENODE_INE EPATHE ENODE_OUTE 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. =item B Save all pending changes to disk. Unless either the B<-b> or B<-n> command line options are given, files are changed in place. =item B ELENSE ENODEE EPATHE Parse NODE using LENS and store the resulting tree at PATH. =item B ELENSE EFILTERE EFILEE 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. =item B EFILEE Load a specific FILE, automatically determining the proper lens from the information in F; without further intervention, the lens that would oridnarily be used for this file will be used. =back =head2 READ COMMANDS The following commands are used to retrieve data from the Augeas tree. =over 4 =item B I<[EPATHE]> Print entries in the tree as XML. If PATH is given, printing starts there, otherwise the whole tree is printed. =item B EPATHE Print the value associated with PATH =item B