3.3 Important Cisco IOS Features
3.3.1 Command-line recall

When you enter a command on the switch, it retains the command in a buffer called the history buffer. On a Cisco IOS command-based switch, the history buffer holds the last ten commands, like a router does. To access these commands, use the up and down arrows on the keyboard.

The history buffer on a set command-based switch stores up to 20 commands. Various devices have specific methods of recalling commands. The switch uses abbreviated key sequences to recall commands.

A "bang" is an ! (exclamation point) on a keyboard. When dictating commands, "exclamation mark" is too difficult to say, so "bang" is used as a verbal shortcut. Table summarizes the key sequence for recalling previous commands in the history buffer.

Sometimes you not only want to recall a command, but you also want to edit it. Table shows the sequences to recall and edit previous commands. Suppose, for example, that you enter the command set vlan 3 2/1-10,4/12-216/1,5/7. This command string assigns a set of ports to VLAN 3. However, you realize after entering the command that you really mean for them to be in VLAN 4 rather than VLAN 3. You could retype the whole command a second time and move the ports to VLAN 4, or you could simply type ^3^4. This forces the Catalyst switch not only to use the previous command, but also to change the number 3 to a number 4, which in this case, corrects the VLAN assignment.

One frustration when mentally recalling commands can be that you have a difficult time remembering what command you entered seven lines previously. This can become particularly challenging because the Catalyst history buffer stores up to 20 commands. Use the history command to see your history buffer. Figure shows output from a history command. Notice that the commands are numbered, allowing you to reference a specific entry for command recall. For example, the output recalls command 2 from the history buffer. This caused the Catalyst switch to recall the history command. Note also that new commands add to the bottom of the list. Newer commands have higher numbers.