display history-command

Function

The display history-command command displays the historical commands saved on the device.

By default, the last 10 historical commands are displayed.

Format

display history-command

display history-command all-users

Parameters

Parameter Description Value
all-users

Displays information about historical commands executed by all users.

-

Views

All views

Default Level

0: Visit level

Task Name and Operations

Task Name Operations
shell execute

Usage Guidelines

Usage Scenario

The display history-command command displays commands that were run recently and help you to search information.

To view historical command execution records of all users, including user information, command execution date and time, and command executed, run the display history-command all-users command.

Precautions

When you use a historical command, note the following:

  • The historical command is saved in the format as it is entered. Therefore, if you enter an incomplete command, the saved command is also incomplete.
  • If you run the same command a number of times on the VRP, the first command is saved only once. If the same command is entered in a different format, the commands in these different formats are all saved.
  • To access the last historical command, use the Up cursor key↑ or Ctrl_P. If there is an earlier historical command, the last historical command is displayed. Otherwise, a bell is generated.
  • For a Windows 9X HyperTerminal, the Up cursor key is invalid because this key is used for other purposes on the Windows 9X HyperTerminal. In this case, you can use

Ctrl_P to replace the key.

  • To access the next historical command, use the Down cursor key or Ctrl_N. If there is a later historical command, the next historical command is displayed. Otherwise, the command is cleared, and a bell is generated.
  • To modify the maximum number of historical commands that can be buffered, run the history-command max-size command.

Example

The actual command output varies according to the device. The command output here is only an example.

# Display information about historical commands executed by all users.
<HUAWEI> display history-command all-users
User    : huawei, VTY2, 10.134.146.150                                      
Time    : 2017-05-08 16:08:35                                                   
Command : diagnose                                                              

User    : huawei, VTY5, 10.179.117.219                                      
Time    : 2017-05-08 16:08:35                                                   
Command : display clock
# Display historical commands.
<HUAWEI> display history-command
  display current-configuration configuration
  display bfd session all verbose
  display bfd statistics session all
  display vrrp
  display vrrp statistics
  display  alarm  history verbose
Table 1 Description of the display history-command command output
Item Description
User

Information about the user who executes the command, including the user name, UI, login IP address. If no user name is specified upon login, the user name is displayed as **.

Time

Time when a command is executed.

Command

Command executed.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >