Ethernet Switching
Ethernet Switching

Smart Port listing command

2 weeks ago

Hi all,

1-) As you see there is list below... How to listed only ge-0/0/1 one? I tried ge-0/0/[^1$] but didn't work.

>show configuration interfaces | display set | match ge-0/0/1
set interfaces ge-0/0/1 description "xxxxx_Connected_2_GatewaycVM_01"
set interfaces ge-0/0/1 unit 0 family ethernet-switching
set interfaces ge-0/0/10 unit 0 family ethernet-switching
set interfaces ge-0/0/11 unit 0 family ethernet-switching
set interfaces ge-0/0/12 description "YYYY_Connected_2_GW415_03"
set interfaces ge-0/0/12 unit 0 family ethernet-switching
set interfaces ge-0/0/13 unit 0 family ethernet-switching
set interfaces ge-0/0/14 unit 0 family ethernet-switching
set interfaces ge-0/0/15 unit 0 family ethernet-switching
set interfaces ge-0/0/16 unit 0 family ethernet-switching
set interfaces ge-0/0/17 unit 0 family ethernet-switching
set interfaces ge-0/0/18 unit 0 family ethernet-switching
set interfaces ge-0/0/19 unit 0 family ethernet-switching

2-) How to listed ONLY ge-0/0/1, ge-0/0/2, ge-0/0/25, ge-0/0/31 and ge-0/0/45 ports? But not like this ge-0/0/1[x]

3 REPLIES 3
Ethernet Switching
Solution
Accepted by topic author Arix
2 weeks ago

Re: Smart Port listing command

2 weeks ago

try with space

show configuration interfaces | display set | match "xe-0/0/1 "

Ethernet Switching

Re: Smart Port listing command

2 weeks ago

Hello,

 


@Arix wrote:

Hi all,

 

2-) How to listed ONLY ge-0/0/1, ge-0/0/2, ge-0/0/25, ge-0/0/31 and ge-0/0/45 ports? 


 

This should help:

 

 

show configuration | display set | match "ge-0/0/1 |ge-0/0/2 |ge-0/0/25|ge-0/0/31|ge-0/0/45"

 

 

If You know You don't have FPC1 nor PIC1 (only FPC 0 PIC0), then You can shorten the expression:

 

show configuration | display set | match "ge-" | match "/1 |/2 |/25|/31|/45"

HTH

Thx

Alex

_____________________________________________________________________

Please ask Your Juniper account team about Juniper Professional Services offerings.
Juniper PS can design, test & build the network/part of the network as per Your requirements

+++++++++++++++++++++++++++++++++++++++++++++

Accept as Solution = cool !
Accept as Solution+Kudo = You are a Star !
Ethernet Switching

Re: Smart Port listing command

2 weeks ago

Thanks 

Both are really good.

Accendently I found the followings with a space like what Akushner pointed.....

>sh conf int | dis se | matc "ge-0/0/[1:2:25:31:45] "

>sh int terse | matc "ge-0/0/[1:2:25:31:45] "

 

really many thanks again for those techniques.