display Commands
Using display commands and understanding command functions are essential skills of maintenance engineers.
Overview
The display commands provide the following information:
- Current device status
- Neighbor device information
- Overall network information
- Network fault location
The display commands can be executed in any view.
The following is an example of display commands:
<AC> display ? aaa AAA access-user User access accounting-scheme Accounting scheme acl <Group> acl command group actual Current actual alarm Alarm antenna Current antenna that outputting radio anti-attack Specify anti-attack configurations ap <Group> ap command group ---- More ----
- After you enter display ?, the system displays all the keywords behind display. More keywords can be added behind these displayed keywords.
- Different device models or versions support different features. The keywords actually displayed may be different from the preceding example.
This section involves only commonly used display commands. For more display commands, see the Command Reference.
Regular Expression in display Commands
Regular Expressions
A regular expression is a mode matching tool. It consists of common characters (such as letters from a to z) and special characters (called meta-characters). The regular expression is a template according to which you can search for the required string.
A regular expression provides the following functions:
- Searches for and obtains a sub-string that matches a rule in the string.
- Substitutes a string based on a certain matching rule.
The regular expression consists of common characters and special characters.
- Common characters
Common characters are used to match themselves in a string, including all upper-case and lower-case letters, digits, punctuations, and special symbols. For example, a matches the letter "a" in "abc", 10 matches the digit "10" in "10.113.25.155", and @ matches the symbol "@" in "xxx@xxx.com".
- Special characters
Special characters are used together with common characters to match the complex or special string combination. Table 19-2 describes special characters and their syntax.
Table 19-2 Description of special charactersSpecial Characters
Function
Example
\
Defines an escape character, which is used to mark the next character (common or special) as the common character.
\* matches "*".
^
Matches the starting position of the string.
^10 matches "10.10.10.1" instead of "172.20.10.1".
$
Matches the ending position of the string.
1$ matches "10.10.10.1" instead of "10.10.10.2".
*
Matches the preceding element zero or more times.
10* matches "1", "10", "100", "1000", and so on.
(10)* matches "null", "10", "1010", "101010", and so on.
+
Matches the preceding element one or more times.
10+ matches "10", "100", "1000", and so on.
(10)+ matches "10", "1010", "101010", and so on.
?
Matches the preceding element zero or one time.
NOTE:Huawei datacom devices do not support regular expressions with ?. When regular expressions with ? are entered on Huawei datacom devices, helpful information is provided.
10? matches "1" or "10".
(10)? matches "null" or "10".
.
Matches any single character.
0.0 matches "0x0", "020", and so on.
.oo. matches "book", "look", "tool", and so on.
()
Defines a subexpression, which can be null. Both the expression and the subexpression should be matched.
100(200)+ matches "100200", "100200200", and so on.
x|y
Matches x or y.
100|200 matches "100" or "200".
1(2|3)4 matches "124" or "134", instead of "1234", "14", "1224", and "1334".
[xyz]
Matches any single character in the regular expression.
[123] matches the character 2 in "255".
[^xyz]
Matches any character that is not in the regular expression.
[^123] matches any character except for "1", "2", and "3".
[a-z]
Matches any character within the specified range.
[0-9] matches any character ranging from 0 to 9.
[^a-z]
Matches any character beyond the specified range.
[^0-9] matches all non-numeric characters.
_
Matches a comma ",", left brace "{", right brace "}", left parenthesis "(", and right parenthesis ")".
Matches the starting position of the input string.
Matches the ending position of the input string.
Matches a space.
_2008_ matches "space 2008 space", ",2008,", "{2008}", "(2008)", "{2008)", and "(2008}".
_2008 matches "space 2008", ",2008", "{2008","(2008".
_2008 matches "2008 space", "2008,", "2008{","2008)".
Unless otherwise specified, all the characters in the preceding table must be printable characters.
- Degeneration of special characters
Certain special characters, when placed at certain positions in a regular expression, degenerate to common characters.
- The special characters following "\" match special characters themselves.
- The special characters "*", "+", and "?" are placed at the starting position of the regular expression. For example, +45 matches "+45" and abc(*def) matches "abc*def".
- The special character "^" is placed at any position except for the start of the regular expression. For example, abc^ matches "abc^".
- The special character "$" is placed at any position except for the end of the regular expression. For example, 12$2 matches "12$2".
- A right parenthesis ")" or right bracket "]" is not paired with a corresponding left parenthesis "(" or bracket "[". For example, abc) matches "abc)" and 0-9] matches "0-9]".
Unless otherwise specified, degeneration rules also apply when the preceding regular expressions are subexpressions within parentheses.
- Combination of common and special characters
In actual usage, regular expressions combine multiple common and special characters to match certain strings.
Specifying a Filtering Mode in a Command
- The device uses a regular expression to implement the pipe character filtering function. A display command supports the pipe character only when there is excessive output information.
- When filtering conditions are set to query output information, the first line of the command output starts with the entire regular expression but not the string to be filtered.
Some commands can carry the keyword | count to display the number of matching entries. The keyword | count can be used together with other keyword.
Three filtering modes are provided for commands that support regular expressions.
- | begin regular-expression: displays all the lines beginning with the line that matches the regular expression.
Filter the character strings to be entered until the specified case-sensitive character string is displayed. All the character strings following this specified character string are displayed on the screen.
- | exclude regular-expression: displays all the lines that do not match the regular expression.
If the character strings to be entered do not contain the specified case-sensitive character string, they are displayed on the screen. Otherwise, they are filtered.
- | include regular-expression: displays all the lines that match the regular expression.
If the character strings to be entered contain the specified case-sensitive character string, they are displayed on the screen. Otherwise, they are filtered.
The value of regular-expression is a string of 1 to 255 characters. If regular-expression contains special characters, to interpret them literally, add a backslash "\" before the characters.
The following examples describe how to specify a filter mode in a command.
Example 1: Run the display interface brief command to display all the lines that do not match the regular expression GigabitEthernet|Wlan-Dbss|Tunnel. GigabitEthernet|Wlan-Dbss|Tunnel matches GigabitEthernet, Wlan-Dbss or Tunnel.
<AC> display interface brief | exclude GigabitEthernet|Wlan-Dbss|Tunnel PHY: Physical *down: administratively down (l): loopback (s): spoofing (b): BFD down (e): ETHOAM down (d): Dampening Suppressed InUti/OutUti: input utility/output utility Interface PHY Protocol InUti OutUti inErrors outErrors Eth-Trunk1 down down 0% 0% 0 0 LoopBack0 up up(s) 0% 0% 0 0 MEth0/0/1 up up 0% 0% 0 0 NULL0 up up(s) 0% 0% 0 0 Vlanif1 up down -- -- 0 0 Vlanif2 down down -- -- 0 0 Vlanif3 down down -- -- 0 0 Vlanif4 down down -- -- 0 0 Vlanif10 up up -- -- 0 0 Vlanif100 down down -- -- 0 0 Vlanif101 down down -- -- 0 0 Vlanif102 down down -- -- 0 0 Vlanif400 up up -- -- 0 0 Wlan-Ess0 down down 0% 0% 0 0 Wlan-Ess1 down down 0% 0% 0 0 Wlan-Ess10 up up 0% 0% 0 0 Wlan-Ess100 down down 0% 0% 0 0
Example 2: Run the display current-configuration command to display all the lines that match the regular expression vlan.
<AC> display current-configuration | include vlan vlan batch 10 400 port trunk allow-pass vlan 10 port trunk pvid vlan 10
The preceding information is used for reference only.
Common display Commands
The device provides various display commands to display hardware, interface, and software information. The information helps you locate various faults.
The following table lists the commands used to collect fault information.
Item |
Command |
Description |
---|---|---|
Basic information |
display diagnostic-information |
This command collects basic system information. It displays outputs of multiple display commands, including display version and display current-configuration. This command is necessary for any network problems. Executing this command takes a long time. You can press Ctrl+C to pause diagnosis information display on screen. |
Device information |
display device |
This command displays card status. If the status of a card is displayed as Abnormal, the card is faulty. |
Interface information |
display interface |
This command displays interface information to help you analyze cause of interface interconnection failures and check statistics on lost packets. |
Versions |
display version |
Version information is important for device fault location. This command displays versions of the system software, BootROM, MPU, fan modules, as well as sizes of storage devices. NOTE:
ACU2 has no fan. |
Patch information |
display patch-information |
This command displays current patch information, including the patch package version and patch package name. |
Electronic label information |
display elabel |
Electronic labels identify information about hardware components of a device. This command displays electronic labels of cards on a device. |
Device status |
display health |
This command displays the temperature, power supply information, fan information, power, CPU usage, memory usage, and storage medium usage of a device. NOTE:
ACU2 has no fan. |
Current configurations |
display current-configuration |
This command displays all configuration information on a device. You can specify a regular expression to obtain the required configuration information. |
Saved configurations |
display saved-configuration |
If a device has started but is not working properly, run the display saved-configuration command to check the startup files specified by the startup saved-configuration command. Run the display saved-configuration last command to check the configuration saved last time. Run the display saved-configuration time command to check the last time when the configuration is saved. |
Time |
display clock |
This command displays the current system date and time. |
User logs |
display logfile buffer |
Executing this command in the diagnostic view can display user logs in the log buffer. |
Diagnostic log |
display diag-logfile buffer |
Executing this command in the diagnostic view can display user logs in the log buffer. |
Alarms |
display trapbuffer |
This command displays information recorded in the trap buffer. |
Memory usage |
display memory-usage |
This command displays memory usage of the device. |
CPU usage |
display cpu-usage |
This command displays CPU usage of the device. |
AP's running information |
V200R005 or earlier: display ap-run-info V200R006 or later: display ap run-info |
This command displays the AP's running information. NOTE:
The prerequisite is that the AP is in normal state. |
AP status |
display ap all |
This command displays the AP status. |
Access user information |
display access-user display station |
This command displays information about an access user. |
Full-process service diagnosis information about an AP or STA |
display trace information |
Before running this command, run the following commands to enable service diagnosis and configure the diagnosis object: [AC6605] trace enable [AC6605] trace object mac-address e468-a352-1160 //e468-a352-1160 is the MAC address of an AP or STA. |