User Tools

Site Tools


howto_sh_pattern_and_interface_cisco

Find all interfaces matching with a certain pattern - Cisco IOS

Here an example with the description field

sh int desc | i DHKESXDDPCOP00+

This will yield the following

Gi1/0/4                        up             up       DHKESXDDPCOP001 SC
Gi1/0/5                        up             up       DHKESXDDPCOP004 SC
Gi1/0/6                        up             up       DHKESXDDPCOP002 SC
Gi1/0/12                       up             up       DHKESXDDPCOP003 SC
Gi2/0/4                        up             up       DHKESXDDPCOP001 DD
Gi2/0/5                        up             up       DHKESXDDPCOP004 DD
Gi2/0/6                        up             up       DHKESXDDPCOP002 DD
Gi2/0/12                       up             up       DHKESXDDPCOP003 DD
Gi3/0/4                        up             up       DHKESXDDPCOP001 NFS
Gi3/0/5                        up             up       DHKESXDDPCOP004 NFS
Gi3/0/6                        up             up       DHKESXDDPCOP002 NFS
Gi3/0/12                       up             up       DHKESXDDPCOP003 NFS
Gi4/0/4                        up             up       DHKESXDDPCOP001 NFS
Gi4/0/5                        up             up       DHKESXDDPCOP004 NFS
Gi4/0/6                        up             up       DHKESXDDPCOP002 NFS
Gi4/0/12                       up             up       DHKESXDDPCOP003 NFS

sh = show

int = interface

desc = description

DHKESXDDPCOP00+ = all descriptors matching DHKESXDDPCOP00 and whatever follows on that line (indicated by the +

 
<!-- AddThis Button BEGIN -->
<a class="addthis_button" href="http://addthis.com/bookmark.php?v=250&amp;username=xa-4beeaaab61b514bf"><img src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a><script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4beeaaab61b514bf"></script>
<!-- AddThis Button END -->
<br>
<br>

Share this knowledge with your friends!

howto_sh_pattern_and_interface_cisco.txt · Last modified: 2012/03/09 10:43 (external edit)