IOS CLI

Important terms:

Cisco IOS - Cisco Internetworking Operating System
CLI - Command Line Interface
EXEC - Command line session to the router (could be console, modem, or telnet)
Flash - Non-Volatile Memory used to store IOS software image
NVRAM - Non-Volatile RAM used to store router configuration
RAM - Random Access Memory

 

CLI Architecture

A Cisco IOS router command line interface can be accessed through either a console connection, modem connection, or a telnet session. Regardless of which connection method is used, access to the IOS command line interface is generally referred to as an EXEC session. As a security feature, Cisco IOS separates EXEC sessions into two different access levels - user EXEC level and privileged EXEC level.

For example, when an EXEC session is started, the router will display a "Router>" prompt. The right arrow (>) in the prompt indicates that the router is at the user EXEC level. The user EXEC level does not contain any commands that might control (e.g. reload or configure) the operation of the router. To list the commands available at the user EXEC level, type a question mark (?) at the Router> prompt. (This feature is referred to as context sensitive help.)

To change to the privileged EXEC level, type "enable" at the Router> prompt. If an enable password is configured, the router will then prompt for that password.  The router prompt will change to "Router#" indicating that the user is now at the privileged EXEC level. To switch back to user EXEC level, type "exit" at the Router# prompt.

 

IOS CLI hierarchy

 

EXEC commands in CONFIG mode

Beginning in Cisco IOS Release 12.1(11b)E, EXEC-level Cisco IOS commands (such as show, clear, and debug commands) can be entered within any configuration mode (such as global configuration mode) by issuing the do command followed by the desired EXEC command. This feature provides the convenience of entering EXEC-level commands without needing to exit the current configuration mode.

e.x.

Router(config)# do show interfaces serial 3/0
Serial3/0 is up, line protocol is up
  Hardware is M8T-RS232
  MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec, rely 255/255, load 1/255
  Encapsulation HDLC, loopback not set, keepalive set (10 sec)
.
.
.

CLI Editor Features

Context Sensitive Help

Cisco IOS CLI offers context sensitive help. This is a useful tool for a new user because at any time during an EXEC session, a user can type a question mark (?) to get help. Two types of context sensitive help are available - word help and command syntax help.

The following is an example of word help:
 

Router# co?
configure connect copy


The following is an example of command syntax help:
 

Router# configure ?
  memory             Configure from NV memory
  network            Configure from a TFTP network host
  overwrite-network  Overwrite NV memory from TFTP network host=20
  terminal           Configure from the terminal
  

 

Command Syntax Check

If a command is entered improperly (e.g. typo or invalid command option), the router will inform the user and indicate where the error has occurred. A caret symbol (^) will appear underneath the incorrect command, keyword, or argument. The following example displays what happens if the keyword "ethernet" is spelled incorrectly.

Router(config)#interface ethernat
                               ^
% Invalid input detected at '^' marker.

 

Command Abbreviation

Commands and keywords can be abbreviated to the minimum number of characters that identifies a unique selection. For example, you can abbreviate the "configure" command to "conf" because "configure" is the only command that begins with "conf". You could not abbreviate the command to "con" because more than one command could fit this criteria. The router will issue the following error message if you do not supply enough characters.

cisco(config)#i
% Ambiguous command:  "i"

 

Hot Keys

For many editing functions, the IOS CLI editor provides hot keys.

Delete - Removes one character to the right of the cursor.
Backspace - Removes one character to the left of the cursor.
TAB - Finishes a partial command.
Ctrl-A - Moves the cursor to the beginning of the current line.
Ctrl-R - Redisplays a line.
Ctrl-U - Erases a line.
Ctrl-W - Erases a word.
Ctrl-Z - Ends configuration mode and returns to the EXEC.
Up Arrow - Allows user to scroll forward through former commands.
Down Arrow - Allows user to scroll backward through former commands.

 

 

 

 

Sources:
https://www.cisco.com/warp/cpropub/45/tutorial.htm
https://www.cisco.com/en/US/docs/ios/fundamentals/configuration/guide/feat-do_cmd_ps6350_TSD_Products_Configuration_Guide_Chapter.html