Home > Articles

  • Print
  • + Share This

Command History and Editing Features

The IOS also provides you with some shortcuts related to entering commands at the EXEC prompt. One method is to abbreviate commands; for example, sh for the command show. A very quick way to enter a previously used command is to use the Command History. The Command History provides you with a list of your most recently used commands (the last 10 commands). To cycle through the commands (most recent to least recent) press the up-arrow key (the down-arrow key moves you in the opposite direction through the list). You can view a list of the commands in the History buffer using the command show history.

You can change the number of commands that are available in the Command History buffer. Use the terminal history size [number] command, where the number is the number of commands you want to be saved in the Command History. This command must be used at the privileged prompt (see the following figure).

Figure 3.6

The IOS also provides several editing commands that can be used to edit or modify a command at the EXEC prompt. Table 3.2 summarizes these editing commands.

Table 3.2 IOS Editing Commands

Command Keys

Result

Ctrl+A

Moves the cursor to the beginning of the command line

Ctrl+E

Moves the cursor to the end of the command line

Esc+F

Moves the cursor forward one word on the command line

Esc+B

Moves the cursor back one word on the command line

Backspace

Moves back one character on the command line, deleting the character to the left of the cursor

Ctrl+F

Moves forward one character from the cursor

Ctrl+B

Moves backward one character from the cursor

Command abbreviation followed by Tab

Completes the abbreviated command (sh becomes show)

Ctrl+P

Same as the up arrow, shows most recent command in History

Ctrl+N

Same as down arrow, moves backward through the History


These command-line editing shortcuts are enabled on a router by default. They can be disabled using the command terminal no editing (executed at the privileged prompt). If you find that you can use these editing shortcuts, though, you can enable them by executing the terminal editing command at the privileged prompt.

 

  • + Share This
  • 🔖 Save To Your Account

Related Resources

There are currently no related titles. Please check back later.