Image of Jeremy L. Gaddis, CCNA, CCNP (and Cortney, in case you were wondering)

Cisco IOS Shortcuts

by Jeremy L. Gaddis on September 6, 2011 · 1 comment

Post image for Cisco IOS Shortcuts

Most people don’t like doing things the hard way. I know I don’t.

While some people think that being lazy is a bad thing, I think that laziness can be a great thing in certain cases.

When it comes to doing repetitive tasks, I prefer to automate them as much as I possibly can. Instead of spending 15 minutes every day doing the same thing, for example, I’d rather spend an hour or two to write some scripts to do it for me. Most experienced system admins and network engineers that I know are the same way.

Fortunately, Cisco IOS affords us a number of opportunities to be lazy efficient.

Tab Completion

The most used “shortcut” in the CLI is tab completion. You may already be familiar with tab completion if you use Linux or UNIX systems.

In the Cisco IOS CLI, you can use the <TAB> key to save you lots of typing. When entering a command into the CLI, simply press the <TAB> key and IOS will “type” the rest of the keyword in for you (assuming that you have entered enough of it for IOS to determine which command you’re referring to).

NOTE: To see these in action and fully understand, go ahead and fire up your router or switch (or Dynamips or Cisco IOU) and follow along.

Let’s try this out with one of the basic IOS commands we’ve already learned, show running-configuration. That’s a long command to type in, especially when you consider how much you’ll be using it. Let’s be lazy efficient!

Enter privileged exec mode, type show run into the CLI, then press the <TAB> key. Your screen should look similar to the following:

Router# show run
Router# show running-config

IOS completed the rest of the keyword for us. You can use tab completion for any commands or keywords anywhere in the CLI. Let’s try it again with another command we’ve already learned, show version.

Type show ver and then press the <TAB> key. Once again, IOS will complete the command for us:

Router# show ver
Router# show version

After IOS completes the command, go ahead and press <ENTER> to execute the command. As you can see, the effect is the same as if we have manually typed in the complete show version command.

Router# show ver
Router# show version
Technical Support:
Copyright (c) 1986-2011 by Cisco Systems, Inc.
Compiled Fri 25-Mar-11 16:59 by prod_rel_team

ROM: Bootstrap program is Linux


Linux Unix (Intel-x86) processor with 140260K bytes of memory.
Processor board ID 2048042
8 Ethernet interfaces
8 Serial interfaces
64K bytes of NVRAM.

Configuration register is 0x0


As you can tell, tab completion is a great way to save time and keystrokes when working in the CLI.

Abbreviate Your Commands

Another great timesaver when working on the CLI is the ability to abbreviate commands. IOS allows us to abbreviate commands we enter as long as we enter enough for IOS to determine which command we are referring to.

Both parts of the show running-configuration command that we often use can be abbreviated, for example. We can abbreviate show as sh and we can abbreviate running-configuration all the way down to run.

Router# sh run
Building configuration...

Current configuration : 1722 bytes
! Last configuration change at 14:55:47 EST Tue Sep 6 2011
version 15.1
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption

Because show is the only command that begins with sh, IOS is able to determine which command we want it to execute. If you abbreviate too much, however, you’ll get that ambiguous command error message we saw in Cisco IOS Error Messages.

Router# s run
% Ambiguous command:  " s run"

Hot Keys

Tab completion and abbreviations aren’t the only shortcuts available in the CLI. IOS also provides a number of “hot keys” that we can use to make our life easier.

Up and Down Arrows

When working in the CLI, you can use the up and down arrows to scroll through the list of commands that you have already entered.

If you’re following along, go ahead and hit the up arrow key. You should see that the CLI is now displaying the show version command that we just ran. If you continue to scroll up, you’ll see the show running-configuration command that we ran earlier. Press the down arrow key and you’ll be returned to the show version command.

Using the arrow keys is a great way to save time when you need to execute a command that you’ve already ran. The CTRL-P and CTRL-N keys also serve the same purpose as the up and down arrows.


Pressing CTRL-C will “interrupt” the command you are currently entering and return you to configuration mode. This is handy if you are entering a long command and then decide that you don’t wish to execute it. Instead of using the backspace key to delete the command you’ve been typing, just press CTRL-C to cancel it.

To illustrate, let’s say that you were in the process of entering in the show ip ospf database command but, at the last minute, you decide not to.

Router# show ip ospf datab

Simply press CTRL-C to cancel the command and return to the prompt.

NOTE: In the following example, ^C depicts the point at which I pressed CTRL-C.

Router# show ip ospf datab^C


The CTRL-Z is useful when you are several levels into the configuration hierarchy and you wish to return to global configuration mode.

In The Cisco CLI: IOS Modes we learned how to that the exit command will return us to the previous configuration mode and the end command will return us to global configuration mode.

CTRL-Z is a shortcut for the end and will also return us to global configuration mode, as seen here:

Router(config-if)# ^Z

NOTE: ^Z depicts the pressing of CTRL-Z.


Pressing CTRL-R will cause IOS to “redraw” the current command that you are typing. This is handy as sometimes output from the CLI will interfere with what you are typing and leave you confused, wondering where exactly you left off.

In this example, I will return to global configuration mode and then begin typing in the show running-configuration command. You can see that output from the router interrupts the command I was typing in. Pressing CTRL-R causes IOS to refresh the line.

Router(config-if)# end
Router# show ru*Sep  6 19:55:47.722: %SYS-5-CONFIG_I: Configured from console by console

While the output does not affect the command you’re typing in, it can make it confusing. Simply press CTRL-R and IOS will refresh the line and you can continue typing in your command.

Router# show ru*Sep  6 19:55:47.722: %SYS-5-CONFIG_I: Configured from console by console^R
Router# show ru


Later, you’ll learn how to use the ping and traceroute commands for troubleshooting and verification. Sometimes, though, we want to interrupt or “cancel” the execution of these commands and we can do that by pressing CTRL-SHIFT-6.

In this example, I am running a traceroute to You can see that, after a certain point, no useful information is returned due to Cisco blocking this traffic with their firewalls. We can sit and wait for it to eventually finish if we want to, but there’s really no point. Instead, we can simply press CTRL-SHIFT-6 to cancel the traceroute.

Router# traceroute
Translating ""...domain server ( [OK]

Type escape sequence to abort.
Tracing the route to (

  1 ( 8 msec 4 msec 4 msec
  2 ( 48 msec 52 msec 56 msec
  3 68 msec 48 msec *
  4  * ( 56 msec 72 msec
  5 ( 56 msec 64 msec 56 msec
  6 ( 56 msec 88 msec 92 msec
  7 ( 72 msec 60 msec 56 msec
  8 ( 60 msec 56 msec 60 msec
  9 ( 80 msec 88 msec 72 msec
 10 ( 56 msec 60 msec 68 msec
 11 ( 52 msec 56 msec 52 msec
 12 72 msec 80 msec 92 msec
 13 ( 80 msec 68 msec 56 msec
 14 ( 64 msec 56 msec 60 msec
 15 ( 64 msec 64 msec 60 msec
 16  *  *  *
 17  *  *  *
 18  *  *  *
 19  *  *

NOTE: CTRL-SHIFT-6 is the “escape sequence” mention on the fourth line of the output.


As you can see, using these shortcuts can save us a lot of time and keystrokes when working in the CLI. For clarity, I’ll usually write out the full commands in these articles but, in practice, I use the shortcuts and abbreviations whenever possible.

Okay, it’s time to begin configuring our routers and switches. First, we’ll learn how to Assign Hostnames to Cisco Devices and then we’ll cover Erasing and Saving Configurations.

Image Source

  • David

    Hi – thanks for the guide. A word of advice/caution with the CTRL-Z sequence: I believe that it actually executes the command you have typed, and then exits. So if you have a potentially interruptive command like a “switchport trunk allowed vlan 123″ already in your line (and note that this is a common mistake to forget the “add” or “remove” after the vlan in this command, thereby removing all existing vlans already in the trunk and placing only vlan 123 in the trunk), the CTRL-Z will execute your command, then end your configuration session. Tip: always configure with terminal monitor on to see the havoc you may be causing! :) HTH

Previous post:

Next post: