Get to Know the Question Mark
Previously,
I said that you can get the available commands by typing
? at the prompt. You can also use this trick to
find the subcommands of any command. For example, if you know you
want to use the copy
command but cannot remember which
subcommand you need, type:
Router#copy ?
WORD Copy from flash device - format <dev:>[partition:][filename]
flash Copy from system flash
flh-log Copy FLH log file to server
mop Copy from a MOP server
rcp Copy from an rcp server
running-config Copy from current system configuration
startup-config Copy from startup configuration
tftp Copy from a TFTP serverAnother use of the question mark is to find all commands that match
what you have typed so far. For example, if you know the first part
of a command, type it and then type a question mark. The router will
return a list of all the matching commands. In the following example,
we remember that the configure command begins with
“co”, but that’s it. The router gives us the
matching commands:
Router#co?
configure connect copyNote the important difference between these two examples. In the
first example, there was a space before the question mark, which gave
us the next command that complements copy. Had
there not been a space, the router would have tried to complete the
word “copy” for us, not given us the next available
commands. In the next example, we did not add the space, so the
router tried to complete “co” with all the commands it
could find that start with “co”.
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