Using the command history function, Viewing history commands – H3C Technologies H3C S12500 Series Switches User Manual
Page 21

9
Using the command history function
The system can automatically save successfully executed commands to the command history buffer for
the current user interface. You can view them and execute them again, or set the maximum number of
commands that can be saved in the command history buffer.
A command is saved to the command history buffer in the exact format as it was entered. For example,
if you enter an incomplete command, the command saved in the command history buffer is also
incomplete; if you enter a command by using a command keyword alias, the command saved in the
command history buffer also uses the alias.
If you execute the same command multiple times, the switch saves the earliest record. However, if you
execute the same command in different formats, the system saves them as different commands. For
example, if you execute the display cu command multiple times, the system saves only one command in
the command history buffer. If you execute the command twice by entering display cu and display
current-configuration, the system saves them as two commands.
By default, the command history buffer can save up to 10 commands for each user. To set the capacity
of the command history buffer for the current user interface, use the history-command max-size
command. For more information about the history-command max-size command, see Fundamentals
Command Reference.
Viewing history commands
You can use arrow keys to access history commands in Windows 200x and Windows XP Terminal or
Telnet. In Windows 9x HyperTerminal, the arrow keys are invalid, and you must use Ctrl+P and Ctrl+N
instead.
To view command history, use one of the following methods:
Task Command
Display all commands in the command history
buffer.
display history-command [ | { begin | exclude | include }
regular-expression ]
Display the previous history command.
Up arrow key or Ctrl+P
Display the next history command.
Down arrow key or Ctrl+N
Setting the command history buffer size for user interfaces
Step Command
Remarks
1.
Enter system view.
system-view
N/A
2.
Enter user interface view.
user-interface { first-num1
[ last-num1 ] | { aux | console |
vty } first-num2 [ last-num2 ] }
N/A
3.
Set the maximum number of
commands that can be saved
in the command history
buffer.
history-command max-size
size-value
Optional.
By default, the command history
buffer can save up to 10
commands.
- H3C S12500-X Series Switches H3C S9800 Series Switches H3C S9500E Series Switches H3C S5560 Series Switches H3C S5130 Series Switches H3C S5120 Series Switches H3C SR8800 H3C SR6600-X H3C SR6600 H3C MSR 5600 H3C MSR 50 H3C MSR 3600 H3C MSR 30 H3C MSR 2600 H3C MSR 20-2X[40] H3C MSR 20-1X H3C MSR 930 H3C MSR 900 H3C WX3000E Series Wireless Switches H3C WX5500E Series Access Controllers H3C WX3500E Series Access Controllers H3C WX2500E Series Access Controllers H3C WX6000 Series Access Controllers H3C WX5000 Series Access Controllers H3C WX3000 Series Unified Switches H3C LSWM1WCM10 Access Controller Module H3C LSUM3WCMD0 Access Controller Module H3C LSUM1WCME0 Access Controller Module H3C LSWM1WCM20 Access Controller Module H3C LSQM1WCMB0 Access Controller Module H3C LSRM1WCM2A1 Access Controller Module H3C LSBM1WCM2A0 Access Controller Module H3C WA3600 Series Access Points H3C WA2600 Series WLAN Access Points H3C SecPath F5020 H3C SecPath F5040 H3C VMSG VFW1000 H3C S10500 Series Switches