Command Line Commands Flashcards
Deck of command line commands and their use cases
show running-configuration
Configuration that is currently running on the device’s memory.
show startup-configuration
Configuration that will be loaded on restart.
show version
The following version information:
Hardware configuration
Running IOS version
ROM bootstrap version
RAM and processor information
show flash
The following flash information:
- Size of the configuration files
- Available flash memory
- Information for all IOS image files stored
on the device
show clock
The current time and date of the device.
show history
Commands in the command history list.
show interface
Information about a router’s interface including:
- Interface status (whether it’s up or down)
- Utilization
- Protocol status on the interface
- Errors
- Maximum transmission unit (MTU)
show ip interface
Information about the configuration of the IP protocols on each interface, including:
- IP address
- Layer 2 status
- Layer 3 status
show ip route
The following routing table information:
- Networks the router can reach
- Metric
- Route to each network
Router# copy run start
Saves the contents of the running-config file to NVRAM.
Router# copy start run
Copies the startup-config file into RAM.
Router# copy run tftp
Saves the contents of the running-config file to a TFTP server.
Router# copy start tftp
Saves the contents of the startup-config file to a TFTP server.
Router# copy tftp start
Copies a configuration file from the TFTP server into NVRAM.
Router# copy tftp run
Copies a configuration file from the TFTP server into RAM.
Router# copy flash tftp
Copies the IOS image to the TFTP server. When using this command, you will be prompted for the destination file name and address.
Router# erase flash
Deletes the contents of Flash memory (deletes the IOS image).
Router# erase start
Erases the contents of the startup-config file.
Router# erase nvram
Deletes the contents of NVRAM (which also erases startup-config).
?
Displays a list of commands available in the current mode
Command ?
Displays keywords and arguments for the specified command
Partial_Command + Tab
Inserts the full command from a partial command
Help Prompts
WORD - Type a one-word response
LINE - Type a multiple-word response
[0-4567] - Type a number within the provided range
[0-FFFFFF] - Type a number within the range in brackets
[cr]> - The command is complete as typed
A.B.C.D - Type an IP address
Command History
The command history feature saves you time by eliminating the need to retype a command you recently entered. Command history temporarily stores a list of commands you have used. Commands stored in command history can be recalled by the user. By default, the system stores up to 10 command lines, but this number can be increased or decreased as needed. The following table describes how to use command history.
Ctrl + P or Up arrow
Shows the previous command
Ctrl + N or Down arrow
Shows the next command
terminal history
Turns command history on
terminal no history
Turns command history off
terminal history size <0-256>
Sets the number of lines in the history buffer
show history
Shows all the commands in the history buffer
Command Editing Facts
The IOS command line interface (CLI) provides shortcuts that make keyboard input easier.
Tab
Completes a command name entry that has been partially entered.
Ctrl + A
Moves to the beginning of the line.
Ctrl + E
Moves to the end of a line.
Ctrl + B or Left Arrow
Goes forward one character.
Esc, B
Goes back one word. Note that you must release the Esc key before pressing B.
Esc, F
Moves forward one word. Note that you must release the Esc key before pressing F.
Ctrl + Z
Quits a configuration mode.
terminal editing
Turns advanced editing on.
terminal no editing
Turns advanced editing off.
Backspace
Removes the character to the left of the cursor.
Ctrl + D
Removes the character at the cursor.
Ctrl + K
Removes all characters from the cursor to the end of the command line.
Esc, D
Removes all characters from the cursor to the end of the word. Note that you must release the Esc key before pressing D.
Ctrl + U or Ctrl + K
Removes all characters from the cursor to the end of the command line.
Ctrl + W
Removes the word to the left of the cursor.
Router(config)# hostname [name]
Changes the name of the router.
Router(config)# int serial 0/0
Router(config)# int s0/0
Router(config)# int Ethernet 0
Router(config)# int ether0
Router(config)# int FastEthernet 0/1
Router(config)# int Fa0/1
Router(config)# int Gigabit 0/1
Router(config)# int gi0/1
Enters the interface configuration mode for the first serial interface. You can use abbreviations for the interface type, such as:
fa = FastEthernet
gi = Gigabit
s = Serial
e = Ethernet
Router(config-if)# description [description text]
Sets a description for a specific interface
Router# config t
Router(config)# hostname ATL1
ATL1(config)#
Sets the hostname of the router to ATL1
Router(config)# int ser 0
Router(config-if)# description ATL to NYC
Adds the description ATL to NYC for the first serial interface on the router.
banner and banner motd
Sets the message-of-the-day (MOTD) banner. The MOTD banner displays immediately after a connection is made.
banner login
Sets the login banner. The login banner displays after the MOTD banner and before the login prompt.
banner exec
Sets the exec banner. The exec banner displays after a successful login.
banner incoming
Sets the incoming banner. The incoming banner displays for a reverse Telnet session.
no banner type
Removes the specified banner.
Router(config)# enable secret password
Sets the encrypted password used for privileged mode access. The enable secret should always be used if it exists.
Router(config)# enable password password
Sets the unencrypted password for privileged mode access. This password is used if enable secret is not set.
Router(config)# Line console interface
This global config command allows a user to enter console configuration mode. The zero identifies the console interface (usually there is only one.)
Router(config)# Line vty vty line [0-15]
This global config command allows a user to enter line VTY mode.
Router(config-line)# Login
VTY access can be enabled using the login command.
Router(config-line)# no enable secret
Router(config-line)# no enable password
Router(config-line)# no login
Router(config-line)# no password
Removes the password. The no login command disables password checking.
Service-password-encryption
It is important to note that the startup-config and running-config files show passwords in plain text. Because of this, you should encrypt your passwords using the global configuration service password-encryption command. This command provides a basic level of encryption to all unencrypted passwords within the config file. Note that these passwords are only lightly encrypted and can be easily broken. However, they do provide some level of security from someone looking over your shoulder. Rather than relying on this encryption, make sure to use the enable secret command for better encryption.
do show run
reveals passwords (does not show if passwords are encrypted)