Hidden Command / Syntax

Unanswered Question
Apr 21st, 2008

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

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4 (1 ratings)
Loading.
sross35 Mon, 04/21/2008 - 09:34

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.

sross35 Mon, 04/21/2008 - 09:42

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.

Yudong Wu Mon, 04/21/2008 - 09:46

try this

show run | i interface Serial|^ desc

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

sross35 Mon, 04/21/2008 - 09:51

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

Yudong Wu Mon, 04/21/2008 - 09:59

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.

Actions

This Discussion