Command Reference Guide

CLI Output Filtering
CLI Command Reference
September 2014 Page 16
HP Moonshot Switch Module CLI Command Reference
CLI Output Filtering
Many CLI show commands display a large amount of content. This can make output difficult to parse through
to find the information of desired importance. The CLI Output Filtering feature allows you to optionally specify
arguments in
show commands to filter the CLI output to display only the desired information. The result is to
simplify the display and make it easier to find the desired information.
The main functions of the CLI Output Filtering feature are:
Pagination Control
Supports enabling/disabling paginated output for all
show CLI commands. When disabled, the output is
displayed in its entirety. When enabled, the command output is displayed page-by-page such that
content does not scroll off the terminal screen until the user presses a key to continue.
Output Filtering
Grep”-like control for modifying the displayed output to show only the user-desired content.
Filter displayed output to include only lines containing a specified string match.
Filter displayed output to exclude lines containing a specified string match.
Filter displayed output to include only lines including and following a specified string match.
Filter displayed output to include only a specified section of the content (e.g. interface 10/1) with a
configurable end-of-section delimiter.
String matching is case insensitive.
Pagination, when enabled, also applies to filtered output.
Example: The following shows an example of the extensions made to the CLI
show commands for the
Output Filtering feature.
(Routing) #show running-config ?
<cr> Press enter to execute the command.
| Output filter options.
<scriptname> Script file name for writing active configuration.
all Show all the running configuration on the switch.
(Routing) #show running-config | ?
begin Begin with the line that matches
exclude Exclude lines that matches
include Include lines that matches
section Display portion of lines
For commands for the feature, see “CLI Output Filtering Commands” on page 142.
Note: Although some HP Moonshot Switch Module show commands already support pagination, the
implementation is unique per command and not generic to all commands.