Table of Contents
Filters for show command display
Some show commands can have a very long display. In order to effectively find the parts of the long show command that you want to see, you can filter the show command display by using the show command followed by a “|” (pipe) to determine what kind of display you want to filter.
R1#show running-config | ? append Append redirected output to URL (URLs supporting append operation only) begin Begin with the line that matches exclude Exclude lines that match include Include lines that match redirect Redirect output to URL section Filter a section of output tee Copy output to URL
The main filters have the following meanings
|Display from the line containing the specified string
|Exclude the lines containing the specified string
|Display only the lines containing the specified string
|Display only the section that contains the specified string
A section is a grouping of lines and the indented lines that follow. The following is an example of the interface FastEtehernet0/0 section of show running-config.
Example of show command display filter
The following is an example of a filter for the show command display.
This is an example of a filter that starts displaying running-config from a line that contains “interface FastEtehernet0/0” as a display filter for begin.
R1#show running-config | begin interface FastEthernet0/0 interface FastEthernet0/0 ip address 192.168.1.254 255.255.255.0 duplex auto speed auto ! ! no ip http server ip forward-protocol nd ! ～省略～
The following is an example of the exclude and include filters: show ip interface brief to see the IP address and status of the interface. This is an example of showing only those interfaces whose interface status is up/up.
You can “exclude down” to exclude the down interface, or “include up” to exclude the up interface. Or you can “include up” to extract and display only the up interfaces.
R1#show ip interface brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.1.254 YES manual up up Loopback0 192.168.0.1 YES manual administratively down down R1#show ip interface brief | exclude down Interface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.1.254 YES manual up up R1#show ip interface brief | include up FastEthernet0/0 192.168.1.254 YES manual up up
Here is an example of a display filter using section. If you specify “section line”, it will show only the section of the line that contains “line”. This will show only the section settings for “line con 0”, the section settings for “line aux 0” and the section settings for “line vty 0 4”.
R1#show running-config | section line line con 0 exec-timeout 0 0 privilege level 15 password 7 094F471A1A0A logging synchronous login line aux 0 exec-timeout 0 0 privilege level 15 password 7 060506324F41 logging synchronous login line vty 0 4 login local
Show only the specific interface part of running-config/startup-config
You can also use show running-config/show startup-config to show only parts of an interface. show running-config/show startup-config is followed by interface <interface-name> is specified, only the part of the interface will be displayed.
R1#show running-config interface loopback 0 Building configuration... Current configuration : 77 bytes ! interface Loopback0 ip address 192.168.0.1 255.255.255.255 shutdown end
- Preparing for Cisco devices configuration
- Configuration files for Cisco devices
- The configuration steps for Cisco devices
- Basic knowledge of the Cisco CLI: Command types and modes
- Cisco device’s interface
- CLI help and completion
- The main error messages in CLI
- Cisco Deleting a configuration command
- default interface command -Initialize the interface settings-
- Entering commands in batches
- do command – Execute EXEC command from configuration mode –
- interface range command -Batch configuration of multiple interfaces-
- Filtering the display of the show command – displaying only the information you want to see –
- Cisco IOS Name Resolution Configuration
- terminal length command : configuration of the number of lines displayed in the command output
- debug command to verify real-time operation
- Automatically enter privileged EXEC mode upon CLI login
- Configure System Clock
- Saving and managing configuration files
- Version Management of Configuration Files ~archive command
- IOS File System Operations
- Managing Cisco Catalyst Switches :What it means to set an IP address on a switch.
- Remote management by VTY access (Telnet/SSH)
- terminal monitor command to display the log of Telnet/SSH login destination
- Multi-step Telnet Session Suspensions
- Set the minimum number of characters in the password [Cisco]
- Restrict login attempts : login block-for command
- Cisco Initial Configuration Example
- CDP – What are the connected devices? –
- Password recovery for Cisco routers
- Password Recovery for Catalyst Switches