Guest

Cisco IOS Software Releases 12.3 T

Show Command Section Filter

Table Of Contents

Show Command Section Filter

Contents

Information About the Show Command Section Filter

How to Use the Show Command Section Filter

Additional References

Related Documents

Standards

MIBs

RFCs

Technical Assistance

Command Reference

show <command> section


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

Release
Modification

12.3(2)T

This feature was introduced.


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

Additional References

Command Reference

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

Related Topic
Document Title

Additional information regarding show command syntax, command mode, defaults, usage guidelines, and examples

Cisco IOS Configuration Fundamentals and Network Management Command Reference, Release 12.3 T.


Standards

Standards
Title

None


MIBs

MIBs
MIBs Link

None

To locate and download MIBs for selected platforms, Cisco IOS releases, and feature sets, use Cisco MIB Locator found at the following URL:

http://www.cisco.com/go/mibs


RFCs

RFCs
Title

None


Technical Assistance

Description
Link

Technical Assistance Center (TAC) home page, containing 30,000 pages of searchable technical content, including links to products, technologies, solutions, technical tips, and tools. Registered Cisco.com users can log in from this page to access even more content.

http://www.cisco.com/public/support/tac/home.shtml


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

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

Any Cisco IOS show command.

include

(Optional) Includes only the lines that contain a particular regular expression. This is the default keyword when none is specified.

exclude

(Optional) Excludes any lines that contain a particular regular expression.

regular-expression

Any regular-expression (text string) found in show command output.


Command Modes

Privileged EXEC

Command History

Release
Modification

12.3(2)T

This command was introduced.


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 interface

interface Ethernet0/0 
interface Ethernet1/0 
interface Serial2/0 
interface Serial3/0

The 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 interface

interface Ethernet0/0 
 shutdown 
 no cdp enable
interface Ethernet1/0 
 shutdown 
 no cdp enable 
interface Serial2/0 
 shutdown 
 no cdp enable 
interface Serial3/0 
 shutdown 
 no cdp enable

Related Commands

Command
Description

show <command> append

Redirects the output of any show command and adds it to the end of an existing file.

show <command> exclude

Filters show command output so that it excludes lines that contain a particular regular expression.

show <command> include

Filters show command output so that it displays only lines that contain a particular regular expression.

show <command> redirect

Redirects the output of any show command to a specified file.