Command-Line Completion
Command-line completion makes the
IOS interface much more user-friendly. It saves you extra typing and
helps out when you cannot remember a command’s syntax. In a
previous example, we used the command configure terminal:
Router#configure terminalBut you could have saved wear and tear on your hands by typing:
Router#conf tIOS expands the command conf
t
to configure
terminal. Another
shortcut is to press Tab after typing “conf”; the router
will fill in the best completion, which is “configure”.
Here is another example:
Router#show running-configThis long command can be shortened to:
Router#sh ruThe router knows that “show” is what you wanted because
show is the only command that begins with
“sh”; likewise, the only subcommand of
show that begins with “ru” is
running-config.
If the router does not understand a command, it repeats the entire
command line and places a caret (^) under the
point at which it ran into trouble. For example:
Router>show itnerface e0
>show itnerface e0
^
% Invalid input detected at '^' marker.The caret symbol is pointing to the “t” in “itnerface”, which is the command the router does not understand. We can quickly fix that by retyping the command:
Router>show interface e0We now get the correct output! Since we also know how to use shortcuts, we can type:
Router>sh int e0With this command we get the same result as its lengthy counterpart. Command-line completion saves a lot of typing, and it helps you keep your sanity when you’re working with ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access