Cisco Command Cheat Sheet
Revised June 27, 2018
Keep these facts in mind ...
- These commands work on routers and IOS-based (not Catalyst OS) switches.
- "Show" commands don't work from ANY config mode (the exception to this is "do show" with newer IOS).
- Config commands don't work from user or privileged ("enable") EXEC mode.
- Hot keys and command keywords are not case-sensitive, BUT HoStNaMeS AND PaSsWoRdS ARE!
Commonly used "show" commands (when specifying [options], don't include the [brackets]):
- s config - The obsolete version of "show start".
- s cont [type number] - Layer-1 info for specified interface, including cable type, DTE/DCE, etc. Example: "sh cont e 3" (NOT "sh cont e3"). Note that for this command (unlike "show interface") there has to be a space between the interface type and identifier ("e 3", not "e3").
- s int [type number] - Layer-2 info for specified interfaces. Example: "sh int e0".
- s [protocol] int [type number] - Layer-3 info for the specified protocol and interface. Example: "sh ip int s2".
- s proto - Active Layer 3 protocols.
- s ip proto - Active IP routing protocols.
- s ip route - Shows the IP routing table (also "s ipx route", "s apple route", etc).
- s run (show running-config) - Shows the running config. Obsoletes "write terminal".
- s start (show startup-config) - Shows the startup config. Obsoletes "show config".
- s ver (show version) - Shows hardware and software version information, and other useful stuff, including the setting of the configuration register.
- wr term (write terminal) - The obsolete version of "show run".
At the "---More---" prompt:
- <Enter> key - Displays the next line.
- Space Bar - Displays the next screen.
- Any other alphanumeric key - Returns you to the EXEC prompt.
On-line Help:
- To see which commands can be executed at a command prompt, press the question mark at the prompt.
- To see which commands begin with a certain sequence of characters, type in the characters, and then press the question mark (no space between the characters and the question mark).
- To see the options for a command, type in the command, then a space, then press the question mark.
Line editing:
- Tab - Completes a partial command name entry.
- Backspace - Erases the character to the left of the cursor.
- Left Arrow - Moves the cursor one character to the left (same as Ctrl-B).
- Right Arrow - Moves the cursor one character to the right (same as Ctrl-F).
- Up Arrow - Recalls commands in the history buffer, beginning with the most recent command (same as Ctrl-P).
- Down Arrow - Recalls more recent commands in the history buffer (same as Ctrl-N).
Control keys - Press and hold the <Ctrl> key, and then press the specified letter key (while still holding the <Ctrl> key):
- Ctrl-A - Moves the cursor to the beginning of the line.
- Ctrl-B - Moves the cursor back one character (same as Left Arrow).
- Ctrl-C - When in any config mode, ends the config mode and returns you to privileged EXEC mode. When in setup mode, aborts back to the command prompt.
- Ctrl-D - Deletes the character at the cursor.
- Ctrl-E - Moves the cursor to the end of the command line.
- Ctrl-F - Moves the cursor forward one character (same as Right Arrow).
- Ctrl-I - Same as Ctrl-R.
- Ctrl-K - Deletes all characters from the cursor to the end of the command line.
- Ctrl-L - Same as Ctrl-R.
- Ctrl-N - Recalls more recent commands in the history buffer (same as Down Arrow).
- Ctrl-P - Recalls commands in the history buffer, beginning with the most recent command (same as Up Arrow).
- Ctrl-R - Redisplays the system prompt and command line after a console message is received (same as Ctrl-I and Ctrl-L). Hint: To automate this process, enable "logging synchronous" in "config-line" mode (i.e., "line console 0").
- Ctrl-T - Transposes the character to the left of the cursor with the character located at the cursor.
- Ctrl-U - Deletes all characters from the cursor back to the beginning of the command line (same as Ctrl-X).
- Ctrl-V - Inserts a code to indicate to the system that the keystroke immediately following should be treated as a command entry, not as an editing key (same as Esc Q).
- Ctrl-W - Deletes the word to the left of the cursor.
- Ctrl-X - Deletes all characters from the cursor back to the beginning of the command line (same as Ctrl-U).
- Ctrl-Y - Recalls the most recent entry in the delete buffer. The delete buffer contains the last ten items you have deleted or cut. Ctrl-Y can be used in conjunction with Esc Y.
- Ctrl-Z - When in any config mode, ends the config mode and returns you to privileged EXEC mode. When in user or privileged EXEC mode, logs you out of the router.
- Ctrl-Shift-6 - All-purpose break sequence. Use to abort DNS lookups, traces, pings, etc.
- Ctrl-Shift-6, followed by x - Suspends (but doesn't terminate) a telnet session. To see the open sessions, use "show sessions". To return to a suspended session, enter that session's number followed by the key. To return to the most recently suspended session, hit the key at the EXEC mode prompt.
Escape sequences - Press and release the <Esc> key, then press the letter key:
- Esc B - Moves the cursor back one word.
- Esc C - Capitalizes the word from the cursor to the end of the word.
- Esc D - Deletes from the cursor to the end of the word.
- Esc F - Moves the cursor forward one word.
- Esc L - Changes the word to lowercase from the cursor to the end of the word.
- Esc Q - Inserts a code to indicate to the system that the keystroke immediately following should be treated as a command entry, not as an editing key (same as Ctrl-V).
- Esc U - Capitalizes from the cursor to the end of the word.
- Esc Y - Recalls the next buffer entry. The buffer contains the last ten items you have deleted. Press "Ctrl-Y" first to recall the most recent entry. Then do "Esc Y" up to nine times to recall the remaining entries in the buffer. If you bypass an entry, continue to press "Esc Y" to cycle back to it.
"Copy" commands (used to backup and restore configs and IOS):
- copy flash tftp - Copies a file from flash to a TFTP server.
- copy run start - Saves the running config to NVRAM. This is an overwrite.
- copy run tftp - Copies the running config to a TFTP server.
- copy start run - Merges the startup config into the running config. This is NOT an overwrite.
- copy start tftp - Copies the startup config to a TFTP server.
- copy tftp flash - Copies a file from a TFTP server to flash.
- copy tftp run - Merges a file on the TFTP server into the running config.
- copy tftp start - Replaces the startup config with a file from a TFTP server.
- Hints for "copy" commands which involve a TFTP server ...
- Make sure that the TFTP server software is configured and running!
- Make sure that the router can see the TFTP server ("Ping" it).
- Execute the appropriate "copy" command.
- Make sure that you READ THE QUESTIONS before you answer them!
Other useful commands (when specifying [options], don't include the [brackets]):
- conf t (configure terminal) - Puts you into global config mode (from the privileged prompt).
- debug [option] - Starts the specified debugging (from the privileged prompt). Use "debug ?" to see the choices.
- en (enable) - Puts you into privileged EXEC mode (from the user mode prompt).
- end - Takes you back to privileged EXEC mode from any "config" mode.
- erase start - Erases the startup config (from the privileged prompt).
- ex (exit) - When in user or privileged EXEC mode, logs you out of the router. When in global config mode, takes you to privileged EXEC mode. When in a specific config mode, takes you back to global config mode.
- int [type number] - Takes you to interface config mode for the specified interface (from any config mode).
- logg sync (logging synchronous) - Turns on automatic redisplay of command lines interrupted by console messages (in "line config" mode).
- no ip domain-lookup - Shuts off DNS name resolution (from global config mode).
- ping - Sends five ICMP "Echo Requests" to the target host (from the user or privileged prompt).
- router [protocol AS-number] - Starts the specified IP routing protocol (from global config mode).
- telnet - Opens a Telnet session to the target host (from the user or privileged prompt).
- term mon (terminal monitor) - Sends debugging messages to the chosen terminal line (from the privileged prompt).
- un all (undebug all, also "no debug all") - Turns off all debugging (from the privileged prompt).
- wr (write memory) - Same as "copy run start".
- wr er (write erase) - Same as "erase start".
Useful terms:
- Flash - Special type of RAM that does not lose its contents when power is removed. Used to store IOS.
- IOS (Internetwork Operating System) - Cisco's operating system. Stored in flash.
- NVRAM (Non-Volatile RAM) - RAM with a battery attached, used to store the startup config.
- POST (Power-On Self-Test) - Diagnostics performed at boot-up, tests the hardware.
- RAM (Random-Access Memory) - Stores frequently-changing data, such as ARP caches, routing tables, packets awaiting forwarding, etc.
- ROM (Read-Only Memory) - Chipset on system board where POST and boot loader (and, on some routers, an IOS subset) are stored.
- running config (also known as "current" or "active" config) - How the router is currently configured. Stored in RAM.
- startup config (also known as "backup" config) - How the router will be configured at the next restart. Stored in NVRAM (actually in Flash on newer devices, where the filename is "config.text").