run

Function

The run command executes a user-view command in a non-user view.

Format

run command-line

Parameters

Parameter Description Value
command-line

Specifies the command to be run.

The value is a string of 1 to 1604 characters, spaces supported.

Views

All views except the user view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
config write

Usage Guidelines

Usage Scenario

To run commands, which can be run only in the user view, in the system view, you must return to the user view. After completing this configuration task, you can run the run command to run such commands in a non-user view without returning to the user view.

Precautions

  • The command specified in the run command must be able to be run in the user view.
  • When you check the command history on the device using the display history-command command, only the commands that you enter are recorded. The command format is run command-line.
  • When you check log information using the CLI/5/CMDRECORD log, only the commands that are actually executed are recorded in logs. The command format is command-line.
  • run cannot be used to execute commands that involve configuration rollback or system software behavior change, such as switch virtual-system, rollback configuration, quit, and patch load.

Example

# View .cfg files in the system view.
<HUAWEI> system-view
[~HUAWEI] run dir *.cfg
Directory of cfcard:/
  Idx  Attr     Size(Byte)  Date        Time       FileName
    0  -rw-         11,970  Mar 14 2012 19:11:22   9300_31.cfg
    1  -rw-         12,033  Apr 22 2012 17:10:30   9300_31_new.cfg
509,256 KB total (118,784 KB free)
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >