Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
New Member

Hidden Command / Syntax

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

Re: Hidden Command / Syntax

try "show run | i interface|desc"

New Member

Re: Hidden Command / Syntax

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.

Re: Hidden Command / Syntax

try "show run | i interface Serial|desc"

New Member

Re: Hidden Command / Syntax

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.

Re: Hidden Command / Syntax

try this

show run | i interface Serial|^ desc

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

New Member

Re: Hidden Command / Syntax

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

Re: Hidden Command / Syntax

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.

New Member

Re: Hidden Command / Syntax

Closer than I was, thanks for the help.

174
Views
4
Helpful
8
Replies
CreatePlease to create content