Cisco Command-Line Interface: usage guide with commands & keys description

Cisco CLI Manual

This article provides information and commands concerning the following topics:


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.

When you are entering a command, you can use the Imagekey to complete the command. Enter the first few characters of a command and press the Imagekey. 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.

Tip

If your keyboard does not have a Imagekey, press Imageinstead.

You may see three types of console error messages when working in the CLI:

  • Ambiguous command

  • Incomplete command

  • Invalid input

The following output shows you how using the question mark can help you work through a command and all its parameters.

Setup mode starts automatically if there is no startup configuration present.

Note

The answer inside the square brackets, [ ], is the default answer. If this is the answer you want, just press Image. Pressing Imageat any time will end the setup process, shut down all interfaces, and take you to user mode (Router>).

Note

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.

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.

Note

If you set the terminal length x command to zero (0), the router will not pause between screens of output.

Note

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?

Note

The last line of output from the show version command tells you what the configuration register is set to.

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.

Note

You can use the pipe parameter and filters with any show command.

Note

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

Click here to view code image

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.

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.

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: