This article provides information and commands concerning the following topics:
Shortcuts for Entering Commands
To enhance efficiency, Cisco IOS Software has some shortcuts for entering commands. Although these are great to use in the real world, when it comes time to take the CCNA 200-301 exam, make sure you know the full commands, not just the shortcuts.
Router> enable = Router> enab = Router> en | Entering a shortened form of a command is sufficient as long as there is no confusion about which command you are attempting to enter |
Router# configure terminal = Router# config t |
Using the Key to Complete Commands
When you are entering a command, you can use the key to complete the command. Enter the first few characters of a command and press the key. If the characters are unique to the command, the rest of the command is entered in for you. This is helpful if you are unsure about the spelling of a command.
Router# sh = Router# show |
If your keyboard does not have a key, press instead.
Console Error Messages
You may see three types of console error messages when working in the CLI:
Ambiguous command
Incomplete command
Invalid input
Error Message | Meaning | What to Do |
% Ambiguous Command: “show con” | Not enough characters were entered to allow device to recognize the command. | Reenter the command with a question mark (?) immediately after the last character: show con? All possible keywords will be displayed |
% Incomplete Command | More parameters need to be entered to complete the command. | Reenter the command followed by a question mark (?). Include a space between the command and the question mark (?) |
% Invalid input detected at ^ marker | The command entered has an error. The ^ marks the location of the error. | Reenter the command, correcting the error at the location of the ^. If you are unsure what the error is, reenter the command with a question mark (?) at the point of the error to display the commands or parameters available |
Using the Question Mark for Help
The following output shows you how using the question mark can help you work through a command and all its parameters.
Router# ? | Lists all commands available in the current command mode |
| Lists all the possible choices that start with the letter c |
| Lists all the possible choices that start with the letters cl |
| Tells you that more parameters need to be entered |
| Shows all subcommands for this command |
Router# clock set 19:50:00 14 July 2019 ? | Pressing the key confirms the time and date configured |
Router# | No Error message/Incomplete command message means the command was entered successfully |
enable Command
Router> enable Router# | Moves the user from user mode to privileged EXEC mode. Notice the prompt changes from > to # |
exit Command
| Logs a user off |
| Moves you back one level |
| Moves you back one level |
end Command
| Moves you from the current mode all the way down to privileged EXEC mode. This example moves from interface configuration mode down to privileged EXEC mode. Notice the prompt changes from Router(config-if)# to Router# |
disable Command
| Moves you from privileged EXEC mode back to user mode |
logout Command
Router# logout | Performs the same function as exit |
Setup Mode
Setup mode starts automatically if there is no startup configuration present.
Router# setup | Enters the System Configuration Dialog from the command line |
The answer inside the square brackets, [ ], is the default answer. If this is the answer you want, just press . Pressing at any time will end the setup process, shut down all interfaces, and take you to user mode (Router>).
You cannot use the System Configuration Dialog (setup mode) to configure an entire router. It does only the basics. For example, you can only turn on RIPv1, but not Open Shortest Path First Protocol (OSPF) or Enhanced Interior Gateway Routing Protocol (EIGRP). You cannot create access control lists (ACLs) here or enable Network Address Translation (NAT). You can assign an IP address to an interface but not to a subinterface. All in all, setup mode is very limiting.
Entering the System Configuration Dialog is not a recommended practice. Instead, you should use the command-line interface (CLI), which is more powerful:
Would you like to enter the initial configuration dialog? [yes]: no
Would you like to enable autoinstall? [yes]: no
Autoinstall is a feature that tries to broadcast out all interfaces when attempting to find a configuration. If you answer yes, you must wait for a few minutes while it looks for a configuration to load. Very frustrating. Answer no.
Keyboard Help
The keystrokes in the following table are meant to help you edit the configuration. Because you’ll want to perform certain tasks again and again, Cisco IOS Software provides certain keystroke combinations to help make the process more efficient.
| Shows you where you made a mistake in entering a command |
| Indicates that the line has been scrolled to left |
| Moves cursor to beginning of line |
| Moves cursor back one word |
| Moves cursor back one character |
| Moves cursor to end of line |
| Moves cursor forward one character |
| Moves cursor forward one word |
| Allows the user to interrupt an IOS process such as ping or traceroute |
| Moves you from any prompt back down to privileged EXEC mode. Can also be used to interrupt the output being displayed and return to privileged EXEC mode |
| Deletes the word to the left of the cursor |
| Deletes the entire line |
| Swaps or transposes the current character with the one before it |
| Erases characters from the cursor to the end of the line |
| Erases characters from the cursor to the beginning of the line |
| Deletes from cursor to the end of the word |
| Removes characters to the right of the cursor |
| Removes characters to the left of the cursor |
| Reprints the line |
| Refreshes the line—use this if the system sends a message to the screen while a command is being entered and you are not using line synchronization. This brings your command to the next line without the message interfering with the command |
| Exits from global configuration mode and moves you to privileged EXEC mode |
| Makes the letter at the cursor uppercase |
| Makes the letter at the cursor lowercase |
| Makes the letters from the cursor to the end of the word uppercase |
| Turns off the ability to use the previous keyboard shortcuts |
| Reenables enhanced editing mode (can use previous keyboard shortcuts) |
History Commands
| Recalls commands in the history buffer in a backward sequence, beginning with the most recent command |
| Returns to more recent commands in the history buffer after recalling commands with the key sequence |
terminal Commands
| Turns off the ability to use keyboard shortcuts |
| Reenables enhanced editing mode (can use keyboard shortcuts) |
Router# terminal length x | Sets the number of lines displayed in a show command to x, where x is a number between 0 and 512 (the default is 24) |
If you set the terminal length x command to zero (0), the router will not pause between screens of output.
Router# terminal history size number | Sets the number of commands in the buffer that can be recalled by the router (maximum 256) |
Router# terminal history size 25 | Causes the router to remember the last 25 commands in the buffer |
Router# no terminal history size 25 | Sets the history buffer back to 10 commands, which is the default |
The history size command provides the same function as the terminal history size command.
Be careful when you set the size to something larger than the default. By telling the router to keep the last 256 commands in a buffer, you are taking memory away from other parts of the router. What would you rather have: a router that remembers what you last typed in or a router that routes as efficiently as possible?
show Commands
Router# show version | Displays information about the current Cisco IOS Software |
Router# show flash | Displays information about flash memory |
Router# show history | Lists all commands in the history buffer |
The last line of output from the show version command tells you what the configuration register is set to.
Using the Pipe Parameter ( | ) with the show or more Commands
By using a pipe (|) character in conjunction with a show command or a more command, you can set filters for specific information that you are interested in.
Router# show running-config | include hostname | Displays configuration information that includes the specific word hostname |
Router# show running-config | section FastEthernet 0/1 | Displays configuration information about the section FastEthernet 0/1 |
The Pipe Parameter (|) Options Parameter | The Pipe Parameter (|) Options Description |
begin | Shows all output from a certain point, starting with the line that matches the filtering expression |
Router# show running-config | begin line con 0 | Output begins with the first line that has the regular expression “line con 0” |
exclude | Excludes all output lines that match the filtering expression |
Router# show running-config | exclude interface | Any line with the regular expression “interface” will not be shown as part of the output |
include | Includes all output lines that match the filtering expression |
Router# show running-config | include duplex | Any line that has the regular expression “duplex” will be shown as part of the output |
Router# show running-config | include ( is ) | Displays only lines that contain the regular expression ( is ). The parentheses force the inclusion of the spaces before and after “is”. This ensures that lines containing “is” with a space before and after it will be included in the output, and output without spaces will be excluded—words like “disconnect” or “isdn” will be excluded |
section | Shows the entire section that starts with the filtering expression |
Router# show running-config | | Displays information about interface GigabitEthernet 0/0 |
Router# more nvram: startup-config | begin ip | Displays output from the startup-config file that begins with the first line that contains the regular expression “ip” |
Router# more nvram: startup-config | include ip | Displays output from the startup-config file that only includes the regular expression “ip” |
You can use the pipe parameter and filters with any show command.
The filtering expression has to match exactly with the output you want to filter. You cannot use shortened forms of the items you are trying to filter. For example, the command
Router# show running-config | section gig0/0
will not work because there is no section in the running-config called gig0/0. You must use the expression GigabitEthernet0/0 with no spelling errors or extra spaces added in.
Using the no and default Forms of Commands
Almost every configuration command has a no form. In general, use the no form to disable a feature or function. Use the command without the no keyword to reenable a disabled feature or to enable a feature that is disabled by default.
Router(config)# router eigrp 100 | Enables the EIGRP routing process with Autonomous System number 100 |
Router(config)# no router eigrp 100 | Disables EIGRP routing process 100 and removes the entire EIGRP configuration from the running configuration |
Router(config)# no ip routing | Disables IP routing on the device (IP routing is enabled by default) |
Router(config)# ip routing | Reenables IP routing on the device |
Many CLI commands also have a default form. By issuing the default command-name command, you can configure the command to its default setting. The Cisco IOS Software command reference documents located on Cisco.com describe the function of the default form of the command when it performs a different function from either the plain form or the no form of the command. To see what default commands are available on your system, enter default ? in the appropriate command mode:
Router(config)# default ? | Lists all commands that are available at this mode for use with the default command |