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.
Example
R1# show running-config | section router ospf
R1# show ip interface brief | include upThe pattern is a case-sensitive regular expression: '| include Gi0/1' matches, '| include gi0/1' does not.
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.
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