Modes and help 13
Almost every configuration command also has a no form that disables the feature or reverses the command; no shutdown, for instance, undoes shutdown.
| Action | Shortcut |
|---|---|
| Enter privileged EXEC modeTyped at the > prompt; the device normally asks for a password, then shows the # prompt. | enable |
| Leave privileged EXEC modeDrops back to the user EXEC prompt without ending the session. | disable |
| Enter global configuration modeThe prompt becomes (config)#; interface, VLAN and line modes are entered from here. | configure terminal |
| Go up one mode levelFrom interface, VLAN or line mode it lands in global configuration, and from there in privileged EXEC. | exit |
| Jump back to privileged EXECWorks from any configuration mode, however deep, unlike exit, which climbs a single level. | end |
| Leave configuration modeKeyboard equivalent of end: one keystroke takes any configuration prompt to the # prompt. | Ctrl+Z |
| Run EXEC command in config modeLets show, clear and debug commands run without leaving configuration; it cannot run configure terminal. | do COMMAND |
| End the sessionTyped at the user EXEC prompt; quit does the same. | logout |
| List commands for this modeAnswers with the commands valid at the current prompt only. | ? |
| List a command's keywordsLeave a space before the question mark, as in show ?, to see what can follow. | COMMAND ? |
| List commands by prefixNo space before the question mark: the example answers dir, disable and disconnect. | di? |
| Complete a partial commandAfter sh conf the key expands the line to show configuration. | Tab |
| Explain the help systemWorks in every command mode and prints a short summary of the built-in help. | help |
Command-line editing keys 22
The arrow-key alternatives need an ANSI-compatible terminal such as a VT100.
| Action | Shortcut |
|---|---|
| Move back one characterPressed repeatedly, it scrolls back to the hidden beginning of a wrapped command. | Ctrl+BorLeft |
| Move forward one character | Ctrl+ForRight |
| Go to start of lineOn a wrapped entry it brings the first characters back into view for a syntax check. | Ctrl+A |
| Go to end of line | Ctrl+E |
| Move back one word | EscthenB |
| Move forward one word | EscthenF |
| Swap two charactersThe pair exchanged is the character before the cursor and the one under it. | Ctrl+T |
| Erase character before cursor | DeleteorBackspace |
| Delete character at cursor | Ctrl+D |
| Delete to end of lineEverything right of the cursor goes; deleted items are held in a buffer for pasting back. | Ctrl+K |
| Delete to start of line | Ctrl+UorCtrl+X |
| Delete word before cursor | Ctrl+W |
| Delete to end of word | EscthenD |
| Paste last deleted textThe buffer it reads keeps the last ten items deleted or cut on the command line. | Ctrl+Y |
| Paste an earlier deletionSteps through older buffer items; past the tenth press it wraps round to the first. | EscthenY |
| Capitalize at the cursor | EscthenC |
| Make word lowercase | EscthenL |
| Uppercase to end of word | EscthenU |
| Enter a keystroke as command | Ctrl+VorEscthenQ |
| Redisplay the command lineHandy when a system message lands in the middle of what is being typed. | Ctrl+LorCtrl+R |
| Scroll output one lineAnswers the More prompt shown when output, such as a show command, is longer than the screen. | Enter |
| Scroll output one screenAt the More prompt it advances a full page instead of a single row. | Space |
History and output filtering 14
Filter expressions are case sensitive: | exclude output hides lines containing output but still shows lines containing Output.
| Action | Shortcut |
|---|---|
| Recall previous commandRepeat it to walk back through older entries; ten command lines are recorded by default. | Ctrl+PorUp |
| Recall next commandMoves forward again after stepping back through the history. | Ctrl+NorDown |
| List recent commandsHow many appear depends on the history size set for the session or the line. | show history |
| Set history size for sessionAccepts 0 to 256 lines and lasts only until the terminal session ends. | terminal history size NUMBER-OF-LINES |
| Turn off command historyApplies to the current terminal session; no history in line configuration disables it for a line. | terminal no history |
| Disable output pagingZero stops the pause between screens for this session; the default length is 24 lines. | terminal length 0 |
| Show only matching linesPut spaces in the expression inside parentheses. | show COMMAND | include REGULAR-EXPRESSION |
| Hide matching linesThe opposite of include: every line containing the expression is left out. | show COMMAND | exclude REGULAR-EXPRESSION |
| Start output at first matchNothing before the first matching line is printed; the match is case-sensitive. | show COMMAND | begin REGULAR-EXPRESSION |
| Show matching sectionsPrints each matching line with the lines that belong to it, such as a whole interface block. | show COMMAND | section REGULAR-EXPRESSION |
| List line protocol statesThe guide's own example: one line per interface saying whether the line protocol is up. | show interfaces | include protocol |
| Send output to a fileThe output goes to the file location given instead of the screen. | show COMMAND | redirect URL |
| Copy output to a fileUnlike redirect, the output still appears on the terminal while it is written. | show COMMAND | tee URL |
| Interrupt long outputStops a search or filter that produces long lists; the manual writes it Ctrl-^. | Ctrl+Shift+6 |
Saving and viewing configuration 14
| Action | Shortcut |
|---|---|
| Show the active configurationThis is what the device runs now; it can differ from the saved startup file. | show running-config |
| Show the saved configurationReads the file kept in NVRAM that is applied at the next system startup. | show startup-config |
| Show one interface's configurationLimits the listing to the lines held in RAM for that interface. | show running-config interface INTERFACE-ID |
| Save the configurationWrites the active settings to the startup file so they are still there after a reload. | copy running-config startup-config |
| Write configuration to startupThe troubleshooting guide lists it beside copy running-config startup-config for the same saving step. | write memory |
| Back up configuration to TFTPPrompts for the server details, then stores the saved configuration on the TFTP server. | copy startup-config tftp: |
| Restore configuration from TFTPRun on another switch, it loads the file copied to the server onto that device. | copy tftp: startup-config |
| Clear the startup configurationThe guide's procedure step writes it erase nvram; a deleted startup file cannot be brought back. | erase startup-config |
| Show software and hardware detailsReports the software release that is loaded; it also runs at the user EXEC prompt. | show version |
| Set the device nameA global configuration command; SSH setup needs a host name before keys are generated. | hostname NAME |
| Restart the deviceIf the configuration was changed, the device asks whether to save it before the reload. | reload |
| Schedule a restartTakes minutes, or hours and minutes as hh:mm, and must fall within about 24 days. | reload in MM |
| Cancel a scheduled restart | reload cancel |
| Check for a scheduled restartTells whether a reload is pending on the device and when. | show reload |
Interfaces 18
| Action | Shortcut |
|---|---|
| Enter interface configuration modeType and number may be written together, as in gigabitethernet1/0/2. | interface INTERFACE-ID |
| Configure several interfaces togetherCommands entered afterwards apply to every port in the range, up to five port ranges. | interface range PORT-RANGE |
| Label an interfaceThe text shows up in show interfaces description. | description STRING |
| Assign an IP addressEntered in interface configuration mode: the address first, then the mask in dotted form. | ip address IP-ADDRESS SUBNET-MASK |
| Enable an interfaceThe no form of shutdown: it restarts a port that was administratively shut down. | no shutdown |
| Disable an interface | shutdown |
| Turn a port into a routed portPuts a physical port into Layer 3 mode so that it can take an IP address. | no switchport |
| Set port speedWhich fixed speeds are offered varies with the switch model and the transceiver module installed. | speed auto |
| Set duplex modeThe other choices are auto and half; the no form goes back to the default. | duplex full |
| Show interface detailsWithout an interface ID it covers every interface on the device. | show interfaces |
| Summarize interface IP statusOne row per interface with its address, status and protocol state. | show ip interface brief |
| Show IP settings of interfacesAdd an interface ID to see a single one. | show ip interface |
| Show port status tableWith err-disabled added it lists only the ports in the error-disabled state. | show interfaces status |
| List interface descriptionsShows the label set on each interface next to its status. | show interfaces description |
| Show switchport state of a portTells whether the port is in routing or switching mode. | show interfaces INTERFACE-ID switchport |
| Show interface error countersDrop the errors keyword for the other counters, or put an interface ID before counters. | show interfaces counters errors |
| Check SFP module statusReports temperature, current and alarm status of the module on an interface. | show interfaces transceiver |
| Reset interface countersAdd an interface ID to clear a single port; SNMP counters are not affected. | clear counters |
VLANs and switching 19
| Action | Shortcut |
|---|---|
| List VLANs and their portsPrints one line per VLAN with its name, status and member ports. | show vlan brief |
| Show a single VLANVLAN IDs run from 1 to 4094. | show vlan id VLAN-ID |
| Create or edit a VLANEnters VLAN configuration mode for that ID; the no form deletes the VLAN. | vlan VLAN-ID |
| Name a VLANTyped in VLAN configuration mode; up to 32 ASCII characters, unique in the administrative domain. | name VLAN-NAME |
| Create a VLAN interface (SVI)The switch virtual interface it creates works at Layer 3 unless configured otherwise. | interface vlan VLAN-ID |
| Make a port an access portThe port stops trunking and carries a single VLAN, whatever the neighbour is set to. | switchport mode access |
| Assign a port to a VLANThe no form puts the port back into the default VLAN. | switchport access vlan VLAN-ID |
| Make a port a trunkTrunking is unconditional: the port carries tagged frames for several VLANs. | switchport mode trunk |
| Limit VLANs on a trunkBy default every VLAN is allowed on a trunk. | switchport trunk allowed vlan VLAN-LIST |
| Set the native VLANChooses the VLAN whose traffic crosses an 802.1Q trunk untagged; VLAN 1 is the default. | switchport trunk native vlan VLAN-ID |
| Stop DTP negotiationNo Dynamic Trunking Protocol packets leave the Layer 2 interface. | switchport nonegotiate |
| Set the voice VLAN | switchport voice vlan VLAN-ID |
| Show trunk portsWithout an interface ID only the active trunking ports are listed. | show interfaces trunk |
| Show the MAC address tableKeywords such as dynamic, interface or vlan narrow the list. | show mac address-table |
| Show spanning tree for a VLANWithout the vlan keyword the command reports every spanning-tree instance. | show spanning-tree vlan VLAN-ID |
| Turn on BPDU guardAn interface configuration command; no spanning-tree bpduguard restores the default. | spanning-tree bpduguard enable |
| Add a port to an LACP bundleThe group number runs from 1 to 128; active enables LACP unconditionally. | channel-group CHANNEL-GROUP-NUMBER mode active |
| Summarize EtherChannel groupsPrints one line for each channel group. | show etherchannel summary |
| Show VTP statusCovers the VTP management domain; counters and password are separate keywords. | show vtp status |
Routing 17
| Action | Shortcut |
|---|---|
| Enable IP routing | ip routing |
| Show the routing tableAn address or a protocol name after the command narrows the output. | show ip route |
| Add a static routeThe next hop may be an address or an outgoing interface; the no form removes the route. | ip route PREFIX MASK ADDRESS |
| Set a default gatewayPackets for other networks are handed to this router. | ip default-gateway IP-ADDRESS |
| Clear the routing tableGive a network and mask in place of the asterisk to remove one route. | clear ip route * |
| Show routing protocol settingsIncludes the administrative distance of each routing process. | show ip protocols |
| Show the ARP table | show arp |
| Show the IP ARP cache | show ip arp |
| Start an OSPF processEnters router configuration for that process; the no form terminates it. | router ospf PROCESS-ID |
| Put a network into an OSPF areaExample from the reference: address, wildcard mask and area ID, typed in router configuration mode. | network 10.0.0.0 0.255.255.255 area 0 |
| List OSPF neighborsOrganised per interface; add detail for the full record of each neighbor. | show ip ospf neighbor |
| Summarize OSPF interfacesWithout brief the command prints the full OSPF data of each interface. | show ip ospf interface brief |
| Start the BGP processTakes the autonomous system number; the no form removes the BGP process. | router bgp AUTONOMOUS-SYSTEM-NUMBER |
| Summarize BGP neighborsThe sample output in the reference lists route-entry peaks for each neighbor. | show ip bgp summary |
| Show the BGP table | show ip bgp |
| Start an EIGRP processA virtual-instance name can be given in place of the number. | router eigrp AUTONOMOUS-SYSTEM-NUMBER |
| List EIGRP neighbors | show ip eigrp neighbors |
Remote access and passwords 13
The number of vty lines depends on the device. The 17.12 security guide for Catalyst 9300 switches configures all of them at once with line vty 0 98, since there are 99 possible sessions.
| Action | Shortcut |
|---|---|
| Set the privileged EXEC secretSets what enable asks for, with stronger protection than the enable password command gives. | enable secret UNENCRYPTED-PASSWORD |
| Encrypt stored passwordsWithout it, passwords can be read in plain form in the configuration file. | service password-encryption |
| Create a local user | username NAME secret PASSWORD |
| Configure the console lineEnters line configuration mode for the console port, which is line 0. | line console 0 |
| Configure vty lines 0 to 4In the sample configuration of the command reference these five lines accept SSH sessions only. | line vty 0 4 |
| Set a line passwordTyped in line configuration mode; on vty lines it is the Telnet password. | password UNENCRYPTED-PASSWORD |
| Log in with local usernamesA vty line command; the reference notes it remains the vty default if aaa new-model is removed without a reload. | login local |
| Restrict lines to SSHThe same sample leaves lines 5 to 9 on transport input all. | transport input ssh |
| Set the idle timeoutHow long the EXEC waits for input on the line; the no form removes the timeout. | exec-timeout MINUTES SECONDS |
| Set the domain nameOne of the steps before generating keys when the device is to be an SSH server. | ip domain name DOMAIN-NAME |
| Generate SSH keysCreating the RSA key pair switches the SSH server on automatically. | crypto key generate rsa |
| Check the SSH serverConfirms that SSH is enabled and shows its version and settings. | show ip ssh |
| List SSH connections | show ssh |
Diagnostics 11
| Action | Shortcut |
|---|---|
| Test reachability of a hostTakes a host name or an address; a host in another subnet needs a route to it. | ping HOST |
| Trace the path to a hostLists the Layer 3 devices, hop by hop, that traffic crosses on the way. | traceroute ip HOST |
| List CDP neighborsFor each neighbor: what kind of device it is, the connecting interfaces, its platform and capabilities. | show cdp neighbors |
| Show CDP neighbor detailsExpands the neighbor list; an interface ID before detail limits it to one port. | show cdp neighbors detail |
| Show log messages on this sessionSends debug output and system error messages to the terminal session you are in, for that session only. | terminal monitor |
| Show debug optionsRun it in privileged EXEC; show debug condition lists the conditional debug options. | show debug |
| Turn off all debuggingDebug output has high CPU priority and can make the system unusable, so switch it off afterwards. | no debug all |
| Find high CPU processesThe first output line gives total CPU use over five seconds, one minute and five minutes. | show processes cpu sorted |
| Collect support informationOne command that runs many show commands and prints their combined system information. | show tech-support |
| Show fans, temperature and power | show environment all |
| List installed hardwareWorks in user EXEC as well; fru, oid and raw are its keywords. | show inventory |
No row on this page matches that filter.
Notes
Modes are everything
IOS commands only exist inside the right mode, and half of early confusion is mode confusion. You land in user EXEC (> prompt), enable lifts you to privileged EXEC (#), and configure terminal enters global configuration ((config)#) — from which commands such as interface INTERFACE-ID, vlan VLAN-ID, router ospf PROCESS-ID and line vty 0 4 descend into sub-modes. show commands are EXEC commands, a limited set of them already available in user EXEC; to run one from inside a configuration mode, prefix it with do. exit steps out one level; Ctrl + Z (or end) jumps straight back to #.
show before you change
The discipline that separates careful operators: read state first. show running-config is live truth; show startup-config is what boots — and the gap between them is unsaved work, which is why copy running-config startup-config ends every change window. show ip interface brief is the fastest health check on the box (every interface with its address, status and protocol state), and show vlan brief, show mac address-table, and show ip route answer the three classic questions: which VLANs exist, who's on this port, and where does traffic go. Long answers stop at a More prompt: Space pages on, Enter moves one line, and terminal length 0 switches the pausing off for the session.
Let the CLI teach you
The help is built into the prompt. ? lists what's valid right here — alone for commands, straight after a partial word for the commands that start with it, after a full word and a space for its keywords and arguments. Tab completes a partial command name, and IOS accepts any abbreviation that is still unique outright: Cisco's own example is show conf for show configuration. The editing keys follow one pattern: Ctrl keys such as Ctrl + A and Ctrl + E work on characters and the whole line, while the Esc sequences (Esc, B, Esc, F, Esc, D) work on words. Whatever Ctrl + K, Ctrl + U / Ctrl + X or Ctrl + W removed comes back with Ctrl + Y.
Questions
What is the difference between running-config and startup-config?
running-config is the live configuration in memory; startup-config is what loads on reboot. Changes apply to running immediately and are lost on reload unless you copy running-config startup-config.
How do I run a show command from inside configuration mode?
Prefix it with do — for example, do show ip interface brief — or press Ctrl+Z to return to privileged EXEC first. Cisco's reference adds that do cannot run configure terminal.
What does Ctrl+Z do in Cisco IOS?
It exits configuration mode entirely, from any depth, straight back to the # prompt — equivalent to the end command.
Can I abbreviate Cisco IOS commands?
Yes, you only need enough characters for the command to be unique: sh run, conf t, int g1/0/1. If the abbreviation is ambiguous, IOS answers "% Ambiguous command", and the same text followed by a space and ? shows the candidates.
What's the fastest way to see all interface states?
show ip interface brief — one line per interface with IP address, status, and protocol. Cisco describes it as a summary of the usability status of each interface.
How do I stop the --More-- prompt in Cisco IOS?
Enter terminal length 0 in EXEC mode. A length of zero stops the pause between screens for the current session only; the default is 24 lines. At the prompt itself, Space shows the next screen and Enter the next line.
How do I show only part of the running configuration?
Add a filter after a pipe: show running-config | include TEXT prints matching lines, | exclude hides them, | begin starts at the first match, and | section prints each match with the lines that belong to it. The expression is case sensitive.
Which IOS release are these commands taken from?
Most rows come from the Cisco IOS XE Dublin 17.12.x command reference and configuration guides for Catalyst 9300 switches; do, exec-timeout, terminal length, terminal monitor and the output filters come from the Cisco IOS Configuration Fundamentals Command Reference. Interface names, vty line counts and available keywords differ between platforms and releases.
Sources and checks
- Cisco — Command Reference, Cisco IOS XE Dublin 17.12.x (Catalyst 9300 Switches): Using the Command-Line Interface Command modes, help, command history, editing keystrokes, More prompt
- Cisco — Command Reference, Cisco IOS XE Dublin 17.12.x (Catalyst 9300 Switches): System Management Commands show version, hostname, show mac address-table, vty line examples
- Cisco — Command Reference, Cisco IOS XE Dublin 17.12.x (Catalyst 9300 Switches): Interface and Hardware Commands show interfaces, show ip interface, speed, duplex, hardware show commands
- Cisco — Command Reference, Cisco IOS XE Dublin 17.12.x (Catalyst 9300 Switches): VLAN Commands vlan, show vlan, show vtp
- Cisco — Command Reference, Cisco IOS XE Dublin 17.12.x (Catalyst 9300 Switches): Layer 2/3 Commands switchport, spanning tree and EtherChannel commands
- Cisco — Command Reference, Cisco IOS XE Dublin 17.12.x (Catalyst 9300 Switches): Routing Commands OSPF, BGP and EIGRP commands
13 more source pages
- Cisco — Command Reference, Cisco IOS XE Dublin 17.12.x (Catalyst 9300 Switches): Security Commands enable secret, username, login local
- Cisco — System Management Configuration Guide, Cisco IOS XE Dublin 17.12.x (Catalyst 9300 Switches): Managing Configuration Files Running and startup configuration, copying configuration files
- Cisco — System Management Configuration Guide, Cisco IOS XE Dublin 17.12.x (Catalyst 9300 Switches): Performing Device Setup Configuration reload and scheduled reloads
- Cisco — System Management Configuration Guide, Cisco IOS XE Dublin 17.12.x (Catalyst 9300 Switches): Troubleshooting the Software Configuration ping, traceroute, debug commands
- Cisco — Interface and Hardware Components Configuration Guide, Cisco IOS XE Dublin 17.12.x (Catalyst 9300 Switches): Configuring Interface Characteristics Interface configuration steps and monitoring commands
- Cisco — IP Routing Configuration Guide, Cisco IOS XE Dublin 17.12.x (Catalyst 9300 Switches): Configuring IP Unicast Routing ip routing, routing table and ARP commands, SVIs
- Cisco — IP Routing Configuration Guide, Cisco IOS XE Dublin 17.12.x (Catalyst 9300 Switches): Protocol-Independent Features Static routes, show ip protocols
- Cisco — Security Configuration Guide, Cisco IOS XE Dublin 17.12.x (Catalyst 9300 Switches): Controlling Switch Access with Passwords and Privilege Levels Line passwords, password encryption, console and vty lines
- Cisco — Security Configuration Guide, Cisco IOS XE Dublin 17.12.x (Catalyst 9300 Switches): Configuring Secure Shell SSH server setup and verification
- Cisco — Network Management Configuration Guide, Cisco IOS XE Dublin 17.12.x (Catalyst 9300 Switches): Configuring Cisco Discovery Protocol show cdp commands
- Cisco — Cisco IOS Configuration Fundamentals Command Reference (Cisco IOS and IOS XE, updated 16 December 2019): D through E do, exit, exec-timeout
- Cisco — Cisco IOS Configuration Fundamentals Command Reference (Cisco IOS and IOS XE, updated 16 December 2019): slave auto-sync config through terminal-type terminal length, terminal monitor
- Cisco — Cisco IOS Configuration Fundamentals Command Reference (Cisco IOS and IOS XE, updated 16 December 2019): show through show fm summary Output filters: begin, include, exclude, section, redirect, tee
Every row on this page was matched to a line in the documentation above on . A binding that could not be found there is not listed.
Found a wrong or missing key? Tell us and it gets checked against the source. How we verify describes the process and its limits.