Editing and Help Features
The Cisco advanced editing features can also help you configure your router. If you type in a question mark ( ? ) at any prompt, you’ll be given a list of all the commands available from that prompt:
access-enable Create a temporary Access-List entry
access-template Create a temporary Access-List entry
archive manage archive files
cd Change current directory
clear Reset functions
clock Manage the system clock
cns CNS agents
configure Enter configuration mode
connect Open a terminal connection
copy Copy from one file to another
debug Debugging functions (see also 'undebug')
delete Delete a file
diagnostic Diagnostic commands
dir List files on a filesystem
disable Turn off privileged commands
disconnect Disconnect an existing network connection
dot1x IEEE 802.1X Exec Commands
enable Turn on privileged commands
erase Erase a filesystem
exit Exit from the EXEC
Press RETURN for another line, SPACE for another page, anything
else to quit
And if this is not enough information for you, you can press the spacebar to get another whole page of information, or you can press Enter to go one command at a time. You can also press Q, or any other
key for that matter, to quit and return to the prompt. Notice that I typed a question mark (?) at the more prompt and it told me what my options were from that prompt.
Here’s a shortcut: To find commands that start with a certain letter, use the letter and the question mark with no space between them, like this:
cd clear clock cns configure
Okay, see that? By typing c? , I got a response listing all the commands that start with c . Also notice that the Switch# c prompt reappears after the list of commands is displayed. This can be really helpful when you happen to be working with long commands but you’re short on patience and still need the next possible one. It would get old fast if you actually had to retype the entire command every time you used a question mark!
So with that, let’s find the next command in a string by typing the first command and then a question mark:
Switch# clock ?
set Set the time and date
Switch# clock set ?
hh:mm:ss Current TimeSwitch# clock set 2:34 ?
% Unrecognized command
Switch# clock set 2:34:01 ?
<1-31> Day of the month
MONTH Month of the year
Switch# clock set 2:34:01 21 july ?
Switch# clock set 2:34:01 21 august 2013
00:19:45: %SYS-6-CLOCKUPDATE: System clock has been updated from
UTC Mon Mar 1 1993 to 02:34:01 UTC Wed Aug 21 2013, configured
I entered the clock ? command and got a list of the next possible parameters plus what they do. Make note of the fact that you can just keep typing a command, a space, and then a question mark until <cr> (carriage return) is your only option left.
And if you’re typing commands and receive
Switch# clock set 11:15:11
% Incomplete command.
no worries—that’s only telling you that the command string simply isn’t complete quite yet. All you need to do is to press the up arrow key to redisplay the last command entered and then continue with the command by using your question mark.
But if you get the error
Switch(config)# access-list 100 permit host 22.214.171.124 host 126.96.36.199
% Invalid input detected at '^' marker.
all is not well because it means you actually have entered a command incorrectly. See that little caret—the ^ ? It’s a very helpful tool that marks the exact point where you blew it and made a mess.
Here’s another example of when you’ll see that caret:
Switch# sh fastethernet 0/0
^% Invalid input detected at '^' marker.
This command looks right, but be careful! The problem is that the full command is show interface fastethernet 0/0 .
Now if you receive the error
Switch# sh cl
Ambiguous command: "sh cl"
you’re being told that there are multiple commands that begin with the string you entered and it’s not unique. Use the question mark to find the exact command you need: