CLI output filtering

Pagination and output filtering options for show commands help you find the information you need in long CLI output.

Many CLI show commands include considerable content to display. This can make output confusing and cumbersome to parse through to find the information of desired importance. The CLI Output Filtering feature allows the user, when executing CLI show display commands, to optionally specify arguments to filter the CLI output to display only desired information. The result is to simplify the display and make it easier for the user to find the information the user is interested in.

The main functions of the CLI output filtering feature are:

  • Pagination Control
    • Supports enabling/disabling paginated output for all show CLI commands. When disabled, output is displayed in its entirety. When enabled, output is displayed page-by-page such that content does not scroll off the terminal screen until the user presses a key to continue. --More-- or (q)uit is displayed at the end of each page.
    • When pagination is enabled, press the return key to advance a single line, press q or Q to stop pagination, or press any other key to advance a whole page. These keys are not configurable.
    Note: Although some switch show commands already support pagination, the implementation is unique per command and not generic to all commands.
  • Output Filtering
    • “Grep”-like control for modifying the displayed output to only show the user-desired content.
    • Filter displayed output to only include lines containing a specified string match.
    • Filter displayed output to exclude lines containing a specified string match.
    • Filter displayed output to only include lines including and following a specified string match.
    • Filter displayed output to only include a specified section of the content (for example, “interface 0/1”) with a configurable end-of-section delimiter.
    • String matching should be case insensitive.
    • Pagination, when enabled, also applies to filtered output.

The following shows an example of the extensions made to the CLI show commands for the Output Filtering feature.

CODE
(NETGEAR Switch) #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.
interface                Display the running configuration for specificed interface
                         on the switch.

(NETGEAR Switch) #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 new commands for the feature, see CLI Output Filtering Commands.