IOS command shortcut favorites

While there are certainly a lot of alternatives today for configuring Cisco routers such as Ciscoworks, GUIs and SNMP, for a lot of tasks, it's hard to beat the good, old fashioned command line. Yet there's no reason to type any more than absolutely necessary. IOS comes with dozens of shortcuts, which are frankly too numerous to remember. In this tip, I've listed my favorites -- the ones used often enough to remember, and a few whose time has passed.

Given the state of terminal support for the dedicated arrow keys, quite a few of the escape sequences just aren't needed anymore. Control (Ctrl)-N and Ctrl-P move up and down the history buffer, but not as well as the "up" and "down" arrow keys. Save your brain cells for more important things! Ctrl-F and Ctrl-B move forward and backward (respectively) on a line. You might see these on a test, but it's a lot easier to remember the right and left arrow keys.

    Requires Free Membership to View

More on this topic

Router Expert: Cool IOS commands

Router Expert: More cool IOS commands - Implementing r-command support

Browse more Routing & Switching tips

The best escape sequence to remember is Ctrl-W. This deletes the last word you typed. The reason it's so useful is because (if you're like me) you probably use the tab-complete feature a lot when you're searching for some command that you know is there, but just can't quite remember. And the utility comes when you're searching a couple words deep. Type the first couple letters, then tab+complete and "?" to look at the new list of options. What you're looking for isn't there? Ctrl-W and "?" again. It'll save a lot of keystrokes.

Ctrl-L and Ctrl-R repeat the current command on a new line. This is useful when you're doing a lot of repetitive tasks, such as configuring access lists.

Ctrl-Z and Ctrl-C are probably common knowledge, but are included for completeness. Use Ctrl-Z to exit configuration mode, and Ctrl-C terminates a process, such as a continuous PING.

Ctrl-A can also be useful, particularly for things like setting temporary aliases. If you're doing something like troubleshooting, where you're typing the same command (debug... for instance) and you want to set it as an alias, just use the "up" arrow to get to the command in the history, and then use Ctrl-A to take you to the beginning of the line where you can insert your alias command (as opposed to holding down the left-arrow key to get to the beginning of the line.)

For further information, you can find a guide to using the terminal editing shortcuts on Cisco's Website.

Command shortcut quick reference

Ctrl-A alias
Ctrl-B move backward
Ctrl-C terminate process
Ctrl-F move forward
Ctrl-L repeat current command on new line
Ctrl-N move up the history buffer
Ctrl-P move down the history buffer
Ctrl-R repeat current command on new line
Ctrl-W delete last word typed
Ctrl-Z exit configuration mode

This was first published in January 2006

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.