2-6
Catalyst 2950 Desktop Switch Software Configuration Guide
78-14982-01
Chapter 2 U sing t he Comman d-Line Inte rface
Usin g C omm and His t o r y

Using Command History

The IOS provid es a history or re cord of com mands tha t you have entered. This fe ature is pa rticularl y
useful for recalling long or complex commands or entries, including access lists. You can customize the
comman d h isto ry fe a ture t o suit y our n eeds as de sc ribed in the se se ctio ns:
Changing the Command History Buffer Size, page 2-6
Recalling Commands, page 2-6
Disabling the C omma nd Histo ry Feat ure, page 2-7

Changing the Command History Buffer Size

By default, the switch records ten command lines in its history buffer. Beginning in privileged EXEC
mode, enter this command to change the number of command lines that the switch records during the
current terminal session:
Switch# terminal history [size number-of-lines]
The range is from 0 to 256.
Beginning i n lin e co nfigur ation m ode , ent er t his co mma nd to c onfigure the nu mb er of c om mand l ine s
the switch records for all sessions on a particular line:
Switch(config-line)# history [size number-of-lines]
The range is from 0 to 256.

Recalling Commands

To re call comm ands fro m the histor y buffer, perf orm one of the actions l isted in Table 2-4:
Table 2-4 Recalling Commands
Action1
1. The arrow keys function only on ANSI-compatible terminals such as VT100s.
Result
Press Ctrl-P or the up ar row key. Reca ll com ma nds in th e hi stor y buffer, begin ning w ith t he most rec en t com mand.
Repeat the key sequence to recall successively older commands.
Press Ctrl-N or the down arrow key. Return to more recent commands in the history buffer after recalling commands
with Ctrl-P or the u p arr ow key. Repe at the key seque nce to re cal l succ essively
mor e recent comm ands.
show history While in privileged EXEC mode, list the last several commands that you just
ente red. Th e nu mber of c om mands t h at a re di spla yed i s dete rmi ne d by the se ttin g
of the terminal history global co nfigur ati on com ma nd and history line
configura tion co mman d.