[an error occurred while processing this directive][an error occurred while processing this directive]

Wildcard Characters in Interface Names

In the show interfaces and clear interfaces commands, you can use wildcard characters in the interface-name option to specify groups of interface names without having to type each name individually. Table 1 lists the available wildcard characters. You must enclose all wildcard characters except the asterisk (*) in quotation marks (“ ”).

Table 1: Wildcard Characters for Specifying Interface Names

Wildcard Character

Description

* (asterisk)

Match any string of characters in that position in the interface name. For example, so* matches all SONET/SDH interfaces.

“[character<character...>]”

Match one or more individual characters in that position in the interface name. For example, so-“[03]”* matches all SONET/SDH interfaces in slots 0 and 3.

“[!character<character...>]”

Match all characters except the ones included in the brackets. For example, so-“[!03]”* matches all SONET/SDH interfaces except those in slots 0 and 3.

“[character1-character1character2]”

Match a range of characters. For example, so-“[0-3]”* matches all SONET/SDH interfaces in slots 0, 1, 2, and 3.

“[!character1-character2]”

Match all characters that are not in the specified range of characters. For example, so-“[!0-3]”* matches all SONET/SDH interfaces in slots 4, 5, 6, and 7.

The following examples illustrate the use of wildcards with operational mode commands:

show interfaces terse (SONET/SDH Interfaces)


user@host> show interfaces terse so*
Interface       Admin Link Proto Local                 Remote
so-1/0/0        up    up
so-1/0/0.0      up    up   inet  192.168.8.192     --> 192.168.2.250
                           iso
so-1/1/0        up    down
so-1/1/0.0      up    down inet  192.168.8.109/30
                           iso
so-1/1/1        up    up
so-1/1/1.0      up    down inet  192.168.8.113/30
                           iso
                           mpls
...
so-1/3/3        up    down
so-5/0/0        up    up
so-5/0/0.0      up    down inet  192.168.8.208     --> 192.168.8.209
                           iso
                           mpls
so-5/0/1        down  down
so-5/0/2        up    down
...

show interfaces terse (SONET/SDH Interfaces in Slot 1)


user@host> show interfaces terse so-“[1]”*
Interface       Admin Link Proto Local                 Remote
so-1/0/0        up    up
so-1/0/0.0      up    up   inet  192.168.2.125     --> 192.168.2.250
                           iso
so-1/1/0        up    down
so-1/1/0.0      up    down inet  192.168.2.150/30
                           iso
so-1/1/1        up    up
so-1/1/1.0      up    down inet  192.168.2.175/30
                           iso
                           mpls
so-1/1/2        up    up
so-1/1/2.0      up    down inet  192.168.2.110/30
                           iso
so-1/2/0        up    down

show interfaces terse (All Interface Types Starting with “S” or “G”)


user@host> show interfaces terse “[sg]”*
Interface       Admin Link Proto Local                 Remote
so-1/0/0        up    up
so-1/0/0.0      up    up   inet  192.168.2.125     --> 192.168.2.250
                           iso
so-1/1/0        up    down
so-1/1/0.0      up    down inet  192.168.2.150/30
                           iso
so-1/1/1        up    up
so-1/1/1.0      up    down inet  192.168.2.175/30
                           iso
                           mpls
so-1/1/2        up    up
...
so-5/1/3        up    down
gre             up    up

Published: 2010-04-28

[an error occurred while processing this directive]