1AUGTOOL(1)                          Augeas                          AUGTOOL(1)
2
3
4

NAME

6       augtool - inspect and modify configuration files
7

SYNOPSIS

9       augtool [OPTIONS] [COMMAND]
10

DESCRIPTION

12       Augeas is a configuration editing tool. It parses configuration files
13       in their native formats and transforms them into a tree. Configuration
14       changes are made by manipulating this tree and saving it back into
15       native config files.
16
17       augtool provides a command line interface to the generated tree.
18       COMMAND can be a single command as described under "COMMANDS". When
19       called with no COMMAND, it reads commands from standard input until an
20       end-of-file is encountered.
21

OPTIONS

23       -c, --typecheck
24           Typecheck lenses. This can be very slow, and is therefore not done
25           by default, but is highly recommended during development.
26
27       -b, --backup
28           When files are changed, preserve the originals in a file with
29           extension '.augsave'
30
31       -n, --new
32           Save changes in files with extension '.augnew', do not modify the
33           original files
34
35       -r, --root=ROOT
36           Use directory ROOT as the root of the filesystem. Takes precedence
37           over a root set with the AUGEAS_ROOT environment variable.
38
39       -I, --include=DIR
40           Add DIR to the module loadpath. Can be given multiple times. The
41           directories set here are searched before any directories specified
42           in the AUGEAS_LENS_LIB environment variable, and before the default
43           directory /usr/share/augeas/lenses.
44
45       -f, --file=FILE
46           Read commands from FILE.
47
48       -i, --interactive
49           Read commands from the terminal. When combined with -f or
50           redirection of stdin, drop into an interactive session after
51           executing the commands from the file.
52
53       -e  When reading commands from a file via stdin, echo the commands
54           before printing their output.
55
56       -s, --autosave
57           Automatically save all changes at the end of the session.
58
59       -S, --nostdinc
60           Do not search any of the default directories for modules. When this
61           option is set, only directories specified explicitly with -I or
62           specified in AUGEAS_LENS_LIB will be searched for modules.
63
64       -L, --noload
65           Do not load any files on startup. This is generally used to fine-
66           tune which files to load by modifying the entries in "/augeas/load"
67           and then issuing a "load" command.
68
69       -A, --noautoload
70           Do not load any lens modules, and therefore no files, on startup.
71           This creates no entries under "/augeas/load" whatsoever; to read
72           any files, they need to be set up manually and loading must be
73           initiated with a "load" command. Using this option gives the
74           fastest startup.
75
76       --version
77           Print version information and exit. The version is also in the tree
78           under "/augeas/version".
79

COMMANDS

81       In interactive mode, commands and paths can be completed by pressing
82       "TAB".
83
84       The paths accepted as arguments by commands use a small subset of XPath
85       path expressions. A path expression consists of a number of segments,
86       separated by "/". In each segment, the character "*" can be used to
87       match every node regardless of its label. Sibling nodes with identical
88       labels can be distinguished by appending "[N]" to their label to match
89       the N-th sibling with such a label. The last sibling with a specific
90       label can be reached as "[last()]". See "EXAMPLES" for some examples of
91       this.
92
93       quit
94           Exit the program
95
96       ls <PATH>
97           List the direct children of PATH
98
99       match <PATTERN> [<VALUE>]
100           Find all paths that match PATTERN. If VALUE is given, only the
101           matching paths whose value equals VALUE are printed
102
103       rm <PATH>
104           Delete PATH and all its children from the tree
105
106       mv <SRC> <DST>
107           Move node SRC to DST. SRC must match exactly one node in the tree.
108           DST must either match exactly one node in the tree, or may not
109           exist yet. If DST exists already, it and all its descendants are
110           deleted. If DST does not exist yet, it and all its missing
111           ancestors are created.
112
113       set <PATH> <VALUE>
114           Associate VALUE with PATH. If PATH is not in the tree yet, it and
115           all its ancestors will be created.
116
117       clear <PATH>
118           Set the value for PATH to NULL. If PATH is not in the tree yet, it
119           and all its ancestors will be created.
120
121       get <PATH>
122           Print the value associated with PATH
123
124       print [<PATH>]
125           Print entries in the tree. If PATH is given, printing starts there,
126           otherwise the whole tree is printed
127
128       ins <LABEL> <WHERE> <PATH>
129           Insert a new node with label LABEL right before or after PATH into
130           the tree. WHERE must be either 'before' or 'after'.
131
132       save
133           Save all pending changes to disk. Unless either the -b or -n
134           command line options are given, files are changed in place.
135
136       load
137           Load files according to the transforms in "/augeas/load".
138
139       defvar <NAME> <EXPR>
140           Define the variable NAME to the result of evaluating EXPR. The
141           variable can be used in path expressions as $NAME. Note that EXPR
142           is evaluated when the variable is defined, not when it is used.
143
144       defnode <NAME> <EXPR> [<VALUE>]
145           Define the variable NAME to the result of evaluating EXPR, which
146           must be a nodeset. If no node matching EXPR exists yet, one is
147           created and NAME will refer to it. If VALUE is given, this is the
148           same as 'set EXPR VALUE'; if VALUE is not given, the node is
149           created as if with 'clear EXPR' would and NAME refers to that node.
150
151       help
152           Print this help text
153

ENVIRONMENT VARIABLES

155       AUGEAS_ROOT
156           The file system root, defaults to '/'. Can be overridden with the
157           -r command line option
158
159       AUGEAS_LENS_LIB
160           Colon separated list of directories with lenses. Directories
161           specified here are searched after any directories set with the -I
162           command line option, but before the default directory
163           /usr/share/augeas/lenses
164

DIAGNOSTICS

166       Normally, exit status is 0. If one or more commands fail, the exit
167       status is set to a non-zero value.
168

EXAMPLES

170         # command line mode
171         augtool print /files/etc/hosts/
172
173         # interactive mode
174         augtool
175         augtool> help
176         augtool> print /files/etc/hosts/
177
178         # Print the third entry from the second AcceptEnv line
179         augtool print '/files/etc/ssh/sshd_config/AcceptEnv[2]/3'
180
181         # Find the entry in inittab with action 'initdefault'
182         augtool> match /files/etc/inittab/*/action initdefault
183
184         # Print the last alias for each entry in /etc/hosts
185         augtool> print /files/etc/hosts/*/alias[last()]
186

FILES

188       Lenses and schema definitions in /usr/share/augeas/lenses
189

AUTHOR

191         David Lutterkort <dlutter@redhat.com>
192
194       Copyright 2007, 2008 Red Hat Inc.
195
196       Augeas (and augtool) are distributed under the GNU Lesser General
197       Public License (LGPL)
198

SEE ALSO

200       Augeas project homepage <http://www.augeas.net/>
201
202       augparse
203
204
205
206Augeas 0.8.0                      2011-02-21                        AUGTOOL(1)
Impressum