LAB 2-1 The Cisco Command Line Interface

1) Shortcuts for Entering Commands

To enhance efficiency, Cisco IOS Software has some shortcuts for entering commands. Entering a shortened form of a command is sufficient as long as there is no confusion about which command you are attempting to enter.

Router>  enable One can write any command out of these three commands to enter into enable mode. All three ways are accepted by Cisco CLI because there is no ambiguity in commands.
Router>  enab
Router>  en
Router#  configure terminal Similarly, one can use any command out of these three commands to enter into the global configuration mode. All shortened form of commands are acceptable provided that they are unambiguous.
Router#  config t
Router#  conf t
2) Using the  [TAB] Key to Complete Commands

When you are entering a command, you can use the TABà key to complete the command. Enter the first few characters of a command and press the TABàkey. If the characters are unique to the command, the rest of the command is entered in for you. This is helpful if you are unsure about the spelling of a command. Router#  sh [TAB]       will complete the word “Show” Router#  show

3) Using the Question Mark for Help

The following output shows you how using the question mark can help somebody work through a command and all its parameters.

Router#  ? Lists all commands available in the current command mode.
Router#  c?clear clock Lists all the possible choices that start with the letter c
Router#  cl?clear clock Lists all the possible choices that start with the letters cl
Router#  clock% Incomplete Command Tells you that more parameters need to be entered
Router#  clock ?Set Shows all sub-commands for this command (in this case, Set)
Router#  clock set 12:50:00 14 May 2012 ? [ENTER] Pressing the [ENTER] key confirms the time and date configured.
Router# No error message/Incomplete command message means the command was entered successfully.
4)Using the Keyboard Shortcuts

The keystrokes in the following table are meant to help you edit the configuration. Because you’ll want to perform certain tasks again and again, Cisco IOS Software provides certain keystroke combinations to help make the process more efficient.

^ Shows you where you made a mistake in entering a command
Ctrl + A Moves cursor to beginning of line
Esc + B Moves cursor back one word
Ctrl + B Moves cursor back one character
Ctrl + E Moves cursor to end of line
Ctrl + F Moves cursor forward one character
Esc + F Moves cursor forward one word
Ctrl + Z Moves you from any prompt back down to privileged mode
$ Indicates that the line has been scrolled to the left
Router# terminal no editingRouter# Turns off the ability to use the previous keyboard Shortcuts
Router# terminal editingRouter# Re-enables enhanced editing mode (can use above keyboard shortcuts)


5) Using History Commands

Cisco Command Line Interface stores most recently used command in its history buffer. One may use CTRL + P   OR  UP-Arrow KEY to see the most recently used command. Similarly one may use DOWN-Arrow KEY to navigate between the list of commands used.

Ctrl + P

Recalls commands in the history buffer in a backward sequence, beginning with the most recent command

Ctrl + N

Returns to more recent commands in the history buffer after recalling commands with the key CTRL-P sequence

terminal history size_ number

See the next row for an example

Sets the number of commands in the buffer that can be recalled by the router(maximum 256)

Router#  terminal history size 50

Causes the router to now remember the last 50 commands in the buffer

Router#  no terminal history size 50

Sets the history buffer back to 10 commands, which is the default

 TIP: Be careful when you set the size to something larger than the default. By telling the router to keep the last 256 commands in a buffer, you are taking memory away from other parts of the router.