Being smarter about show commands

      No Comments on Being smarter about show commands

Sometimes when Im working on Cisco gear I forget to be smart about using show commands.  When I want to look at the BGP configuration I’ll do a ‘show run’ followed by hitting the space bar many times to get to where I need to go.  Or a …

‘show run | b bgp’

Which isn’t super efficient either.  This being said, there are a couple of show commands I need to start using more often.

Includes – You can have the include option display more than one search item.  So you can say something like…

‘show int gi0/0 | i input|ouput’

Which will show us any lines of the ‘show int gi0/0’ output that include the words ‘input’ or ‘output’ like this…

CiscoDevice# show int gi0/0 | i intput|output
        Input flow control is unsupported, output flow control is unsupported
        536908030 packets output, 179256882199 bytes, 0 underruns
        0 pause output, 0 resume output
        0 output errors, 0 collisions, 0 interface resets
        0 input reset drops, 0 output reset drops, 0 tx hangs
        output queue (blocks free curr/low): hardware (255/0)
        536908030 packets output, 168690047881 bytes
      1 minute output rate 23970 pkts/sec,  5670038 bytes/sec
      5 minute output rate 24767 pkts/sec,  6127716 bytes/sec
CiscoDevice#

Sections – You can show a specific section of the code by using the section
statement.  A show command using the section command will look like this…

‘show run | sec bgp’

And the output will show you just the BGP section of the configuration. 

CiscoDevice#show run | sec bgp
router bgp 65002
no synchronization
bgp router-id <IP>
bgp log-neighbor-changes
timers bgp 15 45
neighbor <ip address>
CiscoDevice#

A couple of handy commands to have in your tool belt. 

Leave a Reply

Your email address will not be published.