[Contents] [Prev] [Next] [Index] [Report an Error]


Wildcard Characters in Interface Names

With the show interfaces and clear interfaces commands, you can use wildcard characters when specifying interface names (in the interface-name option) to refer to groups of interface names without having to type each name individually. Table 3 lists the available wildcard characters.

You must enclose all wildcard characters except the asterisk in quotation marks (" ").


Table 3: 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 for those in slots 0 and 3.
"[character1-character2]"
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.

Examples: Use Wildcard Characters in Interface Names

Sample Output: List only 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
...

Sample Output: List only 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
so-1/2/1        up    down
so-1/3/0        up    down

Sample Output: List all interfaces whose type starts 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

[Contents] [Prev] [Next] [Index] [Report an Error]