Searching And Filtering Output From Cli Commands - HP ProCurve 9304M Installation And Configuration Manual

Routing switches
Hide thumbs Also See for ProCurve 9304M:
Table of Contents

Advertisement

Ctrl-Key Combination
Ctrl-E
Ctrl-F
Ctrl-K
Ctrl-L; Ctrl-R
Ctrl-N
Ctrl-P
Ctrl-U; Ctrl-X
Ctrl-W
Ctrl-Z
For a complete list of CLI commands and syntax information for each command, see the Command Line Interface
Reference .

Searching and Filtering Output from CLI Commands

You can filter CLI output from show commands and at the --More-- prompt. You can search for individual
characters, strings, or construct complex regular expressions to filter the output.
Searching and Filtering Output from show commands
You can filter output from show commands to display lines containing a specified string, lines that do not contain
a specified string, or output starting with a line containing a specified string. The search string is a regular
expression consisting of a single character or string of characters. You can use special characters to construct
complex regular expressions. See "Using Special Characters in Regular Expressions" on page 2-29 for
information on special characters used with regular expressions.
Displaying Lines Containing a Specified String
The following command filters the output of the show interface command for port 3/11 so it displays only lines
containing the word "Internet". This command can be used to display the IP address of the interface.
HP9300# show interface e 3/11 | include Internet
Internet address is 192.168.1.11/24, MTU 1500 bytes, encapsulation ethernet
Syntax: <show-command> | include <regular-expression>
NOTE: The vertical bar ( | ) is part of the command.
Note that the regular expression specified as the search string is case sensitive. In the example above, a search
string of "Internet" would match the line containing the IP address, but a search string of "internet" would not.
Displaying Lines That Do Not Contain a Specified String
The following command filters the output of the show who command so it displays only lines that do not contain
the word "closed". This command can be used to display open connections to the HP device.
HP9300# show who | exclude closed
Console connections:
established
Table 2.4: CLI Line Editing Commands (Continued)
Description
Moves to the end of the current command line.
Moves the cursor forward one character.
Deletes all characters from the cursor to the end of the command
line.
Repeats the current command line on a new line.
Enters the next command line in the history buffer.
Enters the previous command line in the history buffer.
Deletes all characters from the cursor to the beginning of the
command line.
Deletes the last word you typed.
Moves from any CONFIG level of the CLI to the Privileged EXEC
level; at the Privileged EXEC level, moves to the User EXEC
level.
Installation
2 - 27

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ProCurve 9304M and is the answer not in the manual?

Table of Contents