Often our router and switch configs will end up being many pages long.  When you need to check that config for a specific line or setting, you’ll often end up pounding the spacebar to scroll through several pages.  The easier way to find what you’re looking for is to search using the pipe (|) command.

Here is an example of the pipe.  This command will search through the running config for anything containing

and the output is:

 

 

To break things down a bit, the include directive (AKA pipe) tells the IOS to only display items that meet specific criteria.  You’ll want to show (sh) a particular set of data (in this case the running config), then use the pipe key (|) and tell it what to include (or exclude)

or, if you want to reduce your typing:

 

 

Other search options.  You can use pipe to search other things than the running configuration.  Here are some examples:

Routes:

Mac addresses:

Show all cdp neighbors and display their IP and Mac addresses:

Display an entire section of the config:

Show all down interfaces:

Or, show all interfaces that aren’t up:

 

Search the Cisco IOS using pipe
Tagged on:                 

Leave a Reply