Show & diagnostics

show <command> | include <regex>

Filter any show output. '| include' keeps matching lines, '| exclude' drops them, '| begin' starts at the first match, '| section' keeps a matching line and everything indented under it, '| count' counts matches.

Works on: Router, Firewall, Switch, Access pointMode: enable

Example

R1# show running-config | section router ospf
R1# show ip interface brief | include up
Watch out

The pattern is a case-sensitive regular expression: '| include Gi0/1' matches, '| include gi0/1' does not.

Run this command live

Don't just read it — type show <command> | include <regex> in a real network simulator in your browser and watch it take effect. No install, no account needed to start.

Open the lab

Frequently asked

What does the "show <command> | include <regex>" command do?

Filter any show output. '| include' keeps matching lines, '| exclude' drops them, '| begin' starts at the first match, '| section' keeps a matching line and everything indented under it, '| count' counts matches.

What's the common gotcha with "show <command> | include <regex>"?

The pattern is a case-sensitive regular expression: '| include Gi0/1' matches, '| include gi0/1' does not.

Example of "show <command> | include <regex>"

R1# show running-config | section router ospf R1# show ip interface brief | include up

More Show & diagnostics commands

← Back to the full command reference

show <command> | include <regex> — network CLI command reference · NetForge-AI