Cli display, Filtering the output information – H3C Technologies H3C SecPath F1000-E User Manual
Page 218
4
CLI Display
The output information filtering function allows you to quickly find the information you are interested in.
When there is a lot of information to be output, the system displays the information in multiple screens.
You can also filter the output information when the information is displayed in multiple screens.
Filtering the Output Information
The device provides the function to filter the output information. You can specify a regular expression to
search the information you need.
To filter the output information:
•
Input the begin, exclude or include keyword plus a regular expression.
•
When the system displays the information in multiple screens, use /, - or + plus a regular
expression. / equals the keyword begin, - equals the keyword exclude, and + equals the
keyword include.
The description of the begin, exclude, and include keywords is as follows:
•
begin: Displays the first line that matches the specified regular expression and all lines that follow.
•
exclude: Displays the lines that do not match the specified regular expression.
•
include: Displays all lines that match the specified regular expression.
A regular expression is a case sensitive string of 1 to 256 characters. It also supports special characters
.
Table 6 Special characters in a regular expression
Character Meaning
Remarks
^string
Starting sign. string appears only at
the beginning of a line.
For example, regular expression “^user” only
matches a string beginning with “user”, not
“Auser”.
string$
Ending sign. string appears only at
the end of a line.
For example, regular expression "user$” only
matches a string ending with “user”, not “userA”.
.
Matches any single character, such
as a single character, a special
character, and a blank.
For example, “.l” matches both “vlan” and “mpls”.
*
Matches the preceding character or
character group zero or multiple
times.
For example, “zo*” matches “z” and “zoo”;
“(zo)*” matches “zo” and “zozo”.
+
Matches the preceding character or
character group one or multiple
times
For example, “zo+” matches “zo” and “zoo”, but
not “z”.
|
Matches the preceding or
succeeding character string
For example, “def|int” only matches a character
string containing “def” or “int”.