Cisco IOS CLI Shortcuts

 

This is a list of the Cisco IOS CLI shortcuts that I need to reference. I really need to practice using the Delete Buffer commands and Ctrl-R Refesh as part of my muscle memory / daily practice.

Cursor Movement Shortcuts
Shortcut Description Mnemonic
Ctrl+A Move cursor to the beginning for the line Alpha, First letter == beginning
Ctrl+E Move cursor to the end of the line E for End
Ctrl+F Move cursor forward one character F for Forward
Ctrl+B Move cursor backward B for Backward
Esc+F Moves forward one word Always forget the escape version
Esc+B Moves backwards one word Ditto
Ctrl+P Previous command P for Previous – also up arrow
Ctrl+N Next command N for Next – also down arrow

Editing Shortcuts
Shortcut Description Mnemonic
Ctrl+W Delete the word to the left from the cursor W for Word
Ctrl+U Delete the whole line ??
Ctrl+T Swap or transpose the current character with the one before it T for Transpose
Ctrl+K Erase characters from the cursor to end of the line ??
Ctrl+X Erase characters from the cursor to beginning of the line ??
Esc+D Delete from Cursor to end of word
Delete Removes the character to the right of the cursor
Backspace Removes the character to the left of the cursor
Up Arrow Allows you to scroll forward through previous commands
Down Arrow Allows you to scroll backwards through previous commands

Functional Shortcuts
Shortcut Description Mnemonic
Ctrl+L Reprint the line L for Line
Ctrl+R Refresh R for Repeat – starts a new line, with the same command shown (If the system sends a message to the screen while a command is being entered and your are not using line synchonisation
Tab Command autocomplete No Comment
Ctrl+C Exit. Exit from config mode
Ctrl+Z Apply the command line and exit from config mode ie. return to privileged EXEC mode.
Ctrl+Shift+6 (X) CTRL-SHIFT-6 is one action, the X is the second action

Less Common Shortcuts
Shortcut Description Mnemonic
Esc, C Makes the letter at the cursor uppercase. C for Capital
Esc, L Changes the word at the cursor to lowercase L for Lower
Esc, U Makes letters from the cursor to the end of the word uppercase. U for Uppercase
Using the Delete Buffer
Shortcut Description Mnemonic
The buffer stores the last ten items that have been deleted using Ctrl-K, Ctrl-U, or Ctrl-X
Ctrl-Y Paste the most recent entry in the delete buffer Y for “Yank” as in Yank from buffer
Esc-Y Paste the Previous entry in the history buffer Y for “Yank” as in Yank from buffer

Note that the delete buffer is very useful for times when you have created complex and difficult names in IOS. If you use a naming convention for QoS CLI such as 100M-5Mpri-15mbAF21 then this is a hugely useful feature for show and configuration commands.

Other Posts in A Series On The Same Topic

  1. Cisco IOS CLI Regex: sh ip bgp in (2nd May 2012)
  2. IOS CLI Tip: More accurate pipe commands (1st May 2012)
  3. Cisco Nexus NXOS and Fixing broken “switchto” syntax with alias (18th December 2011)
  4. show ip eigrp topology all (22nd May 2011)
  5. Cisco IOS CLI Shortcuts (6th February 2011)
  6. The poor man's IOS Traffic Generator (19th September 2009)
  7. IOS: "terminal monitor" on, off - logging to your terminal (17th September 2009)
  8. IOS: Console, Terminal, Monitor, VTY - what is what ? (16th September 2009)
  9. IOS: Clearing an interface configuration (13th September 2009)
  10. IOS: Setting Terminal Window Length (10th September 2009)
  11. IOS CLI: show run linenum (9th September 2009)
  12. IOS: Setting the TCP timeout on IOS (14th August 2008)
  13. IOS: enable and .... disable ? (20th July 2008)
  14. IOS: Reverse SSH console access - Part 2 (25th June 2008)
  15. IOS:Open Source Lab DNS and IP addressing (2nd June 2008)
  16. IOS: Reverse SSH console access (29th May 2008)
  17. ip tcp timestamp (14th April 2008)
  18. Cisco ASA and IOS command tip - test aaa-server (18th February 2008)
About Greg Ferro

Greg Ferro is a Network Engineer/Architect, mostly focussed on Data Centre, Security Infrastructure, and recently Virtualization. He has over 20 years in IT, in wide range of employers working as a freelance consultant including Finance, Service Providers and Online Companies. He is CCIE#6920 and has a few ideas about the world, but not enough to really count.

He is a host on the Packet Pushers Podcast, blogger at EtherealMind.com and on Twitter @etherealmind and Google Plus

You can contact Greg via the site contact page.

  • http://perlmonkey.blogspot.com/ Russell Heilling

    Many of these shortcuts have their origins in the emacs editor. The mnemonic for Ctrl-K is “kill”

    This cheatsheet for the GNU Readline library “emacs mode” shortcuts is a useful comparison to the shortcuts listed here: http://www.catonmat.net/download/readline-emacs-editing-mode-cheat-sheet.pdf

  • http://blog.ioshints.info Ivan Pepelnjak

    Damn, Russell, you were 5 minutes faster ;)

    IOS CLI supports plenty of never-documented Emacs sequences. It was quite entertaining having a student on an RSC course (over 15 years ago) who was an Emacs fan – he started jumping up and down after realizing how many Emacs commands IOS supports.

    • Ben Story

      Hmm maybe I should try CTRL-X CTRL-S instead of wr mem. :)

      • http://www.solucionesdinamicas.net/ Alfredo Sola

        Why do you type mem?

        Speaking of which, I’m a bit pissed off by NX-OS because it no longer supports the immensely useful and inconmensurably short “wr” form and you are forced to type (thanks for Tab/abbreviations, though) the whole “copy running-config startup-config)

        • http://etherealmind.com Greg Ferro

          Because “wr mem” works on ASA, IOS, IOS SX, FWSM, ACE and Nexus. “wr” only works on some platforms.

        • None

           cli alias name wr copy run start

  • http://www.davidsudjiman.info David Sudjiman

    Finally, somebody get all of these magic in one place. Thanks for compiling! I’ve been looking the shortcut to delete word by word due to slow telnet connection.

  • Steve Wright

    Esc+F and Esc+B

    can also be performed using:

    Alt+F and Alt+B

  • Ronald

    ESC + D == ALT + D. I like it better because the escape-key is too far off ;)

  • Daniel

    CTRL+W and CTRL+R are the ones I use the most frequently.

  • Scott

    Great post. I’m gonna start using these in my CCIE lab studies immediately. What about CONTROL+SHIFT+6+6 which breaks out of traceroute and ping without dropping you back to a console server? I use that one all the time.

  • Keith

    Never been able to delete the character to the right of the cursor. Delete and backspace both delete the character to the left of the cursor. Thanks for compiling the list.

    • pgalligan

      CTRL+D deletes the character to the right of the cursor.

      Also, CTRL+U doesn’t delete the whole line, it deletes from the cursor to the beginning of the line, same as CTRL+X.

  • Pingback: Cisco CLI Shortcuts · An IT Guy From Ohio

  • Keith

    Thanks pgalligan for the CTRL+D shortcut info. It works great!

  • Rizky

    Thanks, this will speed up my magic config shui action.

    Is there a shortcut for delete word RIGHT of cursor?

  • Pingback: Technology Short Take #11 - blog.scottlowe.org - The weblog of an IT pro specializing in virtualization, storage, and servers

  • Guest

    your are not using line synchonisation

    you are not using a spell checker….but then again that is probably why you know the shortcuts :)

Subscribe For Weekly Updates by Email

Get a Weekly Summary of Latest Articles and Posts to your Email Inbox Every Sunday

Thanks for signing up. Look for the email from MailChimp & make sure you confirm your email address. You may need to check your spam or gmail settings to be sure of receiving the email.

Note: You can unsubscribe at any time using the link at the bottom of every email.