01-01 How To Use Command Lines
01-01 How To Use Command Lines
User When a user logs in to the In the user view, you can view
view device, the user enters the user the running status and statistics
view and the following prompt is of the device.
displayed on the screen:
<Huawei>
System Run the system-view command In the system view, you can set
view and press Enter in the user view. the system parameters of the
The system view is displayed. device, and enter other function
<Huawei> system-view views from this view.
Enter system view, return user view with
Ctrl+Z.
[Huawei]
Interface Run the interface command and You can configure interface
view specify an interface type and parameters in the interface view.
number to enter an interface The interface parameters include
view. physical attributes, link layer
[Huawei] interface gigabitethernet X/Y/Z protocols, and IP addresses.
[Huawei-GigabitEthernetX/Y/Z]
NOTE
● X/Y/Z indicates the number of an
interface that needs to be
specified. It is in the format of
slot number/sub card number/
interface sequence number.
● The interface GigabitEthernet is
only an example.
NOTE
● The command line prompt Huawei is the default host name (sysname). The prompt
indicates the current view. For example, <> indicates the user view and [] indicates all
other views except user view.
● Some commands can be executed in multiple views, but they have different functions
after being executed in different views. For example, you can run the lldp enable
command in the system view to enable LLDP globally and in the interface view to
enable LLDP on an interface.
● In the system view, you can run the diagnose command to enter the diagnostic view.
Diagnostic commands are used for device fault diagnosis. If you run some commands in
the diagnostic view, the device may run improperly or services may be interrupted.
Contact technical support personnel and use these diagnostic commands with caution.
To return from the interface view directly to the user view, press Ctrl+Z or run the
return command.
# Press Ctrl+Z to return directly to the user view.
[Huawei-GigabitEthernet0/0/1] #Press Ctrl+Z.
<Huawei>
Backspace Deletes the character on the left of the cursor and the
cursor moves to the left. When the cursor reaches the
head of the command, an alarm is generated.
Left cursor key ← or Moves the cursor to the left by the space of a
Ctrl+B character. When the cursor reaches the head of the
command, an alarm is generated.
Right cursor key → or Moves the cursor to the right by the space of a
Ctrl+F character. When the cursor reaches the end of the
command, an alarm is generated.
Operating Techniques
Incomplete Keyword
You can enter incomplete keywords on the device. In the current view, you do not
need to enter complete keywords if the entered characters can match a unique
keyword. This function improves operating efficiency.
For example, to execute the display current-configuration command, you can
enter d cu, di cu, or dis cu, but you cannot enter d c or dis c because they do not
match unique keywords.
NOTE
Tab
Enter an incomplete keyword and press Tab to complete the keyword.
● When a unique keyword matches the input, the system replaces the
incomplete input with the unique keyword and displays it in a new line with
the cursor leaving a space behind. For example:
a. Enter an incomplete keyword.
[Huawei] info-
b. Press Tab.
The system replaces the entered keyword and displays it in a new line
with the complete keyword followed by a space.
[Huawei] info-center
● When the input has multiple matches, press Tab repeatedly to display the
keywords beginning with the incomplete input in a circle until the desired
keyword is displayed. In this case, the cursor closely follows the end of the
keyword. For example:
a. Enter an incomplete keyword.
[Huawei] info-center log
b. Press Tab.
The system displays the prefixes of all the matched keywords. In this
example, the prefix is log.
[Huawei] info-center logbuffer
Press Tab to switch from one matched keyword to another. In this case,
the cursor closely follows the end of a word.
[Huawei] info-center logfile
[Huawei] info-center loghost
b. Press Tab.
[Huawei] info-center loglog
The system displays information in a new line, but the keyword loglog
remains unchanged and there is no space between the cursor and the
keyword, indicating that this keyword does not exist.
Full Help
When entering a command, you can use the full help function to obtain keywords
and parameters for the command. Use any of the following methods to obtain full
help from a command line.
● Enter a question mark (?) in any command view to obtain all the commands
and their simple descriptions. For example:
<Huawei> ?
User view commands:
backup Backup information
cd Change current directory
cls Clear screen
copy Copy from one file to another
debugging <Group>debugging command group
delete Delete a file
...
Partial Help
If you enter only the first or first several characters of a command keyword, partial
help provides keywords that begin with this character or character string. Use any
of the following methods to obtain partial help from a command line.
● Enter a character string followed directly by a question mark (?) to display all
keywords that begin with this character string. For example:
<Huawei> d?
debugging <Group> debugging command group
delete Delete a file
dir List files on a filesystem
display Display information
<Huawei>d
NOTE
The command output obtained through the online help function is used for reference only.
Login authentication
Username:huawei
Password:
-----------------------------------------------------------------------------
Username:huawei
Password:
-----------------------------------------------------------------------------
NOTE
The command output provided here is used for reference only. The actual output
information may differ from the preceding information.
NOTE
If the value is too large, it may take a long time to obtain a required history command.
Therefore, a large value is not recommended.
Display the later Down arrow key ↓ or Ctrl+N If there is a later history
history command. command, the later
history command is
displayed. Otherwise, the
command is cleared and
an alarm is generated.
NOTE
You cannot access history commands using the Up arrow key ↑ in HyperTerminal Windows
9X. The Up arrow key ↑ has a different function in Windows 9X and need to be replaced by
the shortcut key Ctrl+P.
NOTE
The terminal in use may affect the functions of the shortcut keys. For example, if the
shortcut keys defined by the terminal conflict with those defined in the system, the shortcut
keys entered by the user are captured by the terminal program and the commands
corresponding to the shortcut keys are not executed.
The system supports four user-defined shortcut keys and the default values are as
follows:
● Ctrl+G: display current-configuration
● Ctrl+L: undo idle-timeout
● Ctrl+O: undo debugging all
● Ctrl+U: Null
NOTE
● When defining shortcut keys, use double quotation marks to define the command if this
command contains several keywords separated by spaces. For example, hotkey ctrl_l
"display tcp status". Do not use double quotation marks to define a command if the
command contains only one keyword.
● Run the display hotkey command to view the status of the defined, undefined, and
system-defined shortcut keys.
● Run the command to restore default values of the configured shortcut keys.
● Shortcut keys are executed in the same way as commands. The system can record
commands in their original formats in the command buffer and logs to help query and
locate the fault.
● The user-defined shortcut keys are available to all users. If a user does not have the
rights to use the command defined by a shortcut key, the system displays an error
message when this shortcut key is executed.
Key Function
Key Function