Entering a question mark (? ) at the system prompt displays a list of commands available for each command mode. You also can get a list of the arguments
and keywords available for any command with the context-sensitive help feature.
To get help specific to a command mode, a command name, a keyword, or an argument, use any of the following commands:
Command
|
Purpose
|
|
Displays a brief description of the help system.
|
(prompt
)#
abbreviated-command-entry?
|
Lists commands in the current mode that begin with a particular character string.
|
(prompt
)# abbreviated-command-entry
<Tab >
|
Completes a partial command name.
|
|
Lists all commands available in the command mode.
|
|
Lists the available syntax options (arguments and keywords) for the command.
|
(prompt
)# command
keyword ?
|
Lists the next available syntax option for the command.
|
Note that the system prompt will vary depending on which configuration mode you are in.
When context-sensitive help is used, the space (or lack of a space) before the question mark (? ) is significant. To obtain a list of commands that begin with a particular character sequence, type in those characters followed
immediately by the question mark (? ). Do not include a space. This form of help is called word help, because it completes a word for you. For more information,
see the “Completing a Partial Command Name ” section later in this chapter.
To list keywords or arguments, enter a question mark (? ) in place of a keyword or argument. Include a space before the ? . This form of help is called command syntax help, because it shows you which keywords or arguments are available based on
the command, keywords, and arguments you already have entered.
You can abbreviate commands and keywords to the number of characters that allow a unique abbreviation. For example, you can
abbreviate the
configure terminal command to
config t . Because the abbreviated form of the command is unique, the router will accept the abbreviated form and execute the command.
Entering the help command (available in any command mode) will provide the following description of the help system:
Router#
help
Help may be requested at any point in a command by entering
a question mark '?'. If nothing matches, the help list will
be empty and you must back up until entering a '?' shows the
available options.
Two styles of help are provided:
1. Full help is available when you are ready to enter a
command argument (e.g. 'show ?') and describes each possible
argument.
2. Partial help is provided when an abbreviated argument is entered
and you want to know what arguments match the input
(e.g. 'show pr?'.)
As described in the
help command output, you can use the question mark (? ) to complete a partial command name (partial help), or to obtain a list of arguments or keywords that will complete the current
command.
The following example illustrates how the context-sensitive help feature enables you to create an access list from configuration
mode.
Enter the letters
co at the system prompt followed by a question mark (? ). Do not leave a space between the last letter and the question mark. The system provides the commands that begin with
co .
Router# co?
configure connect copy
Enter the
configure command followed by a space and a question mark to list the keywords for the command and a brief explanation:
Router# configure ?
memory Configure from NV memory
network Configure from a TFTP network host
overwrite-network Overwrite NV memory from TFTP network host
terminal Configure from the terminal
<cr>
The <cr> symbol (“cr” stands for carriage return) appears in the list to indicate that one of your options is to press the
Return or Enter key to execute the command, without adding any keywords. In this example, the output indicates that your options
for the configure command are
configure memory (configure from NVRAM),
configure network (configure from a file on the network),
configure overwrite-network (configure from a file on the network and replace the file in NVRAM), or
configure terminal (configure manually from the terminal connection). For most commands, the <cr> symbol is used to indicate that you can execute
the command with the syntax you have already entered. However, the configure command is a special case, because the CLI will
prompt you for the missing syntax:
Router# configure
Configuring from terminal, memory, or network [terminal]? terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#
The default response for the ? prompt is indicated in the CLI output by a bracketed option at the end of the line. In the
preceding example, pressing the Enter (or Return) key is equivalent to typing in the word “terminal.”
Enter the
configure terminal command to enter global configuration mode:
Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#
The CLI provides error isolation in the form of an error indicator, a caret symbol ( ^). The ^ symbol appears at the point
in the command string where the user has entered incorrect or unrecognized command syntax. For example, the caret symbol in
the following output shows the letter that was mistyped in the command:
Router# configure terminal
^
% Invalid input detected at '^' marker.
Router#
Note that an error message (indicated by the % symbol) appears on the screen to alert you to the error marker.
Enter the
access-list command followed by a space and a question mark to list the available options for the command:
Router(config)# access-list ?
<1-99> IP standard access list
<100-199> IP extended access list
<1100-1199> Extended 48-bit MAC address access list
<1300-1999> IP standard access list (expanded range)
<200-299> Protocol type-code access list
<2000-2699> IP extended access list (expanded range)
<700-799> 48-bit MAC address access list
dynamic-extended Extend the dynamic ACL absolute timer
rate-limit Simple rate-limit specific access list
The two numbers within the angle brackets represent an inclusive range. Enter the access list number
99 and then enter another question mark to see the arguments that apply to the keyword and brief explanations:
Router(config)# access-list 99 ?
deny Specify packets to reject
permit Specify packets to forward
Enter the
deny argument followed by a question mark (? ) to list additional options:
Router(config)# access-list 99 deny ?
A.B.C.D Address to match
Generally, uppercase letters represent variables (arguments). Enter the IP address followed by a question mark (? ) to list additional options:
Router(config)# access-list 99 deny 172.31.134.0 ?
A.B.C.D Mask of bits to ignore
<cr>
In this output, A.B.C.D indicates that use of a wildcard mask is allowed. The wildcard mask is a method for matching IP addresses
or ranges of IP addresses. For example, a wildcard mask of 0.0.0.255 matches any number in the range from 0 to 255 that appears
in the fourth octet of an IP address.
Enter the wildcard mask followed by a question mark (? ) to list further options:
Router(config)# access-list 99 deny 172.31.134.0 0.0.0.255 ?
<cr>
The <cr> symbol by itself indicates there are no more keywords or arguments. Press Enter (or Return) to execute the command.:
Router(config)# access-list 99 deny 172.31.134.0 0.0.0.255
The system adds an entry to access list 99 that denies access to all hosts on subnet 172.31.134.0, while ignoring bits for
IP addresses that end in 0 to 255.