HP 6125G HP 6125G & 6125G/XG Blade Switches Fundamentals Configuration - Page 15

Using the command history function, Viewing history commands

Page 15 highlights

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 enter a command in the same format repeatedly in succession, the system buffers the command only once. If you enter a command repeatedly in different formats, the system buffers each command format. For example, display cu and display current-configuration are buffered as two entries but successive repetitions of display cu create only one entry in the buffer. 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. 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 Display all commands in the command history buffer. Display the previous history command. Display the next history command. Command display history-command [ | { begin | exclude | include } regular-expression ] Up arrow key or Ctrl+P Down arrow key or Ctrl+N Setting the command history buffer size for user interfaces Step 1. Enter system view. Command system-view 2. Enter user interface view. user-interface { first-num1 [ last-num1 ] | { aux | vty } first-num2 [ last-num2 ] } 3. Set the maximum number of commands that can be saved in the command history buffer. history-command max-size size-value Remarks N/A N/A Optional. By default, the command history buffer can save up to 10 commands. 9

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135

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 enter a command in the same format repeatedly in succession, the system buffers the command
only once. If you enter a command repeatedly in different formats, the system buffers each command
format. For example,
display cu
and
display current-configuration
are buffered as two entries but
successive repetitions of
display cu
create only one entry in the buffer.
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.
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
|
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.