Table Of Contents
Information About the Show Command Section Filter
How to Use the Show Command Section Filter
Show Command Section Filter
This feature adds the capability to filter associated sections of output from show commands in the Cisco IOS command-line interface (CLI).
Feature History for the Show Command Section Filter Feature
Finding Support Information for Platforms and Cisco IOS Software Images
Use Cisco Feature Navigator to find information about platform support and Cisco IOS software image support. Access Cisco Feature Navigator at http://www.cisco.com/go/fn. You must have an account on Cisco.com. If you do not have an account or have forgotten your username or password, click Cancel at the login dialog box and follow the instructions that appear.
Contents
•
Information About the Show Command Section Filter
•
How to Use the Show Command Section Filter
Information About the Show Command Section Filter
The Show Command Section Filter feature enhances the functionality of the Cisco IOS CLI by filtering show command output matching a regular expression (text string) as well as filtering output associated with that expression. Prior to this enhancement, the level of filtering offered by the show command was limited to the individual lines of the output.
In many cases, it is useful to filter the output of a show command to match a specific expression. Filtering provides some control over the type and amount of information displayed by the system. With section filtering, show command output not only displays the individual entries matching the expression in the command output but also displays the section of entries associated with that expression.
Filtering is especially useful, for example, when displaying a large configuration file. In this case, it is helpful to display sections of the configuration file without having to enter multiple commands to gather the related configuration information.
How to Use the Show Command Section Filter
No configuration tasks are associated with this enhancement. For usage guidelines, see the command pages.
Additional References
For information about specific show and more commands, see the Cisco IOS documentation set for Release 12.3 T, available on Cisco.com.
The following sections provide references related to the Show Command Section Filter feature.
Related Documents
Standards
MIBs
MIBs MIBs LinkNone
To locate and download MIBs for selected platforms, Cisco IOS releases, and feature sets, use Cisco MIB Locator found at the following URL:
RFCs
Technical Assistance
Command Reference
This section documents new commands. All other commands used with this feature are documented in the Cisco IOS Release 12.3 T command reference publications.
show <command> section
To filter the output of a show command to match a given expression as well as any lines associated with that expression, use the show command section command in privileged EXEC mode.
show command | section [include | exclude] regular-expression
Syntax Description
Command Modes
Privileged EXEC
Command History
Usage Guidelines
In many cases, it is useful to filter the output of a show command to match a specific expression. Filtering provides some control over the type and amount of information displayed by the system. The show section command provides enhanced filtering capabilities by matching lines in the show command output containing specific expressions as well as matching any entries associated with those expressions. Filtering is especially useful, for example, when displaying large configuration files using the show running-configuration command or the show interfaces command.
If the include or exclude keyword is not specified, include is the default.
If there are no associated entries for an expression, then only the line matching the expression is displayed.
Examples
The following examples compare the filtering characteristics of the show running-config | include command with the show running-config | section command. The first example gathers just the lines from the configuration file with "interface" in them.
Router# show running-config | include interfaceinterface Ethernet0/0 interface Ethernet1/0 interface Serial2/0 interface Serial3/0The next example uses the show command section command to gather the lines in the configuration file with "interface" in them as well as any lines associated with those entries. In this example, interface configuration information is captured.
Router# show running-config | section include interfaceinterface Ethernet0/0 shutdown no cdp enableinterface Ethernet1/0 shutdown no cdp enable interface Serial2/0 shutdown no cdp enable interface Serial3/0 shutdown no cdp enableRelated Commands
Copyright © 2003 Cisco Systems, Inc. All rights reserved.

