cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
860
Views
4
Helpful
8
Replies

Hidden Command / Syntax

sross35
Level 1
Level 1

Looking for the command to filter multiple lines from a configuration. I found it online a couple of months ago but didn't write it down and now can't find it.

I am trying to 'sh run | i ...' where it will show me each interface in the running config as well as the description but no other interface information, such as...

interface Serial1/0/1:0

desc Company A

!

interface Serial1/0/2:0

desc Company B

and so on. Can someone recall the correct syntax? Thanks

8 Replies 8

Yudong Wu
Level 7
Level 7

try "show run | i interface|desc"

Pretty close and that will work, but it there a way to limit it further by interface type such as serial interfaces only and their descriptions?

I got a little closer with

sh int | i Serial|Desc

but that shows desc from other interfaces without the interface heading.

try "show run | i interface Serial|desc"

That's pretty close too, but shows desc from other lines such as bgp neighbor desc and prefix-list desc.

Maybe it's not possible, but I will keep checking.

try this

show run | i interface Serial|^ desc

Note: there is a space between "^" and "desc"

Still get only the "interface Serial" lines but also get desc from other interfaces also.

Such as

interface Serial1/0/1:0

desc Company A

interface Serial1/0/2:0

desc Company B

interface Serial1/0/3:0

description Company C

description Ethernet Company D

description GigbitEthernet Company E

the pipe operator "|" is line by line based. So it can not tell whether "description" is for serial or not since this need interpret result of the previous line.

So, it think it might not work by only using "|".

Sorry, i am not aware of the other solution for you.

Closer than I was, thanks for the help.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card