
Help
The option that displays the available options for a command is ?
Router#show ? aaa Show AAA values access-lists List access lists arp Arp table cdp CDP information class-map Show QoS Class Map clock Display the system clock controllers Interface controllers status crypto Encryption module debugging State of each debugging option dhcp Dynamic Host Configuration Protocol status dot11 IEEE 802.11 show information file Show filesystem information flash: display information about flash: file system flow Flow information frame-relay Frame-Relay information history Display the session command history hosts IP domain-name, lookup style, nameservers, and host table interfaces Interface status and configuration ip IP information ipv6 IPv6 information license Show license information line TTY line information --More--
Here the ?
shows the possible commands with show.
- The
--More--
indicates that there are too many commands for the display window. - The
Enter
key scrolls line by line. - The
Space
key scrolls block by block.
Autocompletion
Commands autocomplete with the tab key.
Here are some examples:
sh <tab>
becomesshow
int
becomesinterface
You can start typing the command and press TAB as soon as possible. There may be ambiguity. You need to continue typing to specify the command to the system. So it can complete it correctly.
Filtering results
🫱 Adding |
after a command allows you to filter its result:
interface GigabitEthernet0/0/0interface GigabitEthernet0/0/1interface GigabitEthernet0/0/2interface Vlan1
Here include
filters the result to include the word interface
.
Abbreviated commands
The Cisco CLI supports command abbreviations.
Here are some examples:
Abbreviation | Full command |
---|---|
conf t | configure terminal |
sh ip int b | show interface brief |
wr | Write memory |
int g0/0 | interface GigabitEthernet0/0 |
Error reporting
The environment indicates where there is an error.
Incorrect syntax or wrong mode (do “command”).
Router#sh ip routte ^% Invalid input detected at '^' marker.
Keyboard shortcuts
Sequence | Description |
---|---|
CTRL + A | Beginning of line |
CTRL + E | End of line |
CTRL + P or ↓ | Previous command |
CTRL + N or ↑ | Next command |
CTRL + F or → | Cursor right |
CTRL + B or ← | Cursor left |
CTRL + Z | Return to privileged mode |
CTRL + C | Interrupt |
CTRL + SHIFT + 6 / CTRL + SHIFT + ^ | Forced interruption |
TAB | Complete a command |
Backspace | Erase a character to the left |
CTRL + R | Redisplay the line |
CTRL + U | Erase the line |
CTRL + W | Erase a word |
ESC + b | Move back a word |
ESC + f | Move forward a word |
Some tips
The do
command allows you to execute a privileged mode command in another mode.
Switch(config)#show run ^% Invalid input detected at '^' marker.
Switch(config)#do show runBuilding configuration...
Disabling DNS lookups
With DNS resolution (enabled by default), a mistyped command can be interpreted, in privileged mode, as an attempt to connect to a remote domain and block the console for some time:
Switch#showeTranslating "showe"...domain server (255.255.255.255)
To disable DNS resolution:
no ip domain-lookup
Disabling announcements
Each time you change the state of an interface (up, down, etc…)
The device writes a message in the CLI, indicating what has changed.
This can be annoying when typing commands.
It is possible to disable these announcements:
%LINK-1-CHANGED: Interface FastEthernet0/1, changed state to up
no logging console
Renaming a device
hostname MY_SWITCH
Setting an enable password
To enter the “enable” mode of the device, it is possible and even recommended to set a password.
Switch(config)#enable secret MY_PASSWORD
With the secret
option, the password is hashed.
Viewing the general configuration
To display information about the global configuration (hostname, services, interfaces, spanning-tree, password, etc.), execute this command:
Switch#show running-configBuilding configuration...
Current configuration : 1080 bytes!version 15.0no service timestamps log datetime msecno service timestamps debug datetime msecno service password-encryption!hostname Switch!!!!!!spanning-tree mode pvstspanning-tree extend system-id!interface FastEthernet0/1!interface FastEthernet0/2--More--
Viewing VLAN configuration
To display information about VLAN configuration:
Switch#show vlan
VLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4 Fa0/5, Fa0/6, Fa0/7, Fa0/8 Fa0/9, Fa0/10, Fa0/11, Fa0/12 Fa0/13, Fa0/14, Fa0/15, Fa0/16 Fa0/17, Fa0/18, Fa0/19, Fa0/20 Fa0/21, Fa0/22, Fa0/23, Fa0/24 Gig0/1, Gig0/21002 fddi-default active1003 token-ring-default active1004 fddinet-default active1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1 enet 100001 1500 - - - - - 0 01002 fddi 101002 1500 - - - - - 0 01003 tr 101003 1500 - - - - - 0 01004 fdnet 101004 1500 - - - ieee - 0 01005 trnet 101005 1500 - - - ibm - 0 0 --More--
NOTEVLANs 1002, 1003, 1004, 1005 are reserved in the system for token ring. This system being obsolete, these VLANs are not used.
Here interfaces F0/1-24 and G0/1-2 belong to VLAN 1.
Removing/disabling an element
The no
suffix allows you to remove/disable/delete any previously written command or configuration.
no ip address 192.168.1.1 255.255.255.0
Removes the IP address assigned to the interface.
Router(config)#no router ospf
Disables the OSPF protocol (and its configuration) from the router.