路由器中常用的过滤命令有 begin exclude include
其后跟着的正则表达式,我只想说其中的一个符号的用法,就是下划线的作用,引用下思科的原文:
原文地址:
http://www.cisco.com/c/en/us/td/docs/ios-xml/ios/fundamentals/configuration/15_sy/fundamentals-15-sy-book/cf-cli-search.html
_ (underscore) | Matches a comma (,), left brace ({), right brace (}), left parenthesis ( ( ), right parenthesis ( ) ), the beginning of the string, the end of the string, or a space. |
C2#show ip inte brief p | include xgei-0/2/0/1
xgei-0/2/0/1 15.1.1.1 255.255.255.0 up up up
xgei-0/2/0/10 unassigned unassigned up up up
我本来是想只看到xgei-0/2/0/1 这一个接口的,可是现在却也能看到xgei-0/2/0/10 ,为了解决这个问题,可以使用下划线。
C2#show ip inte brief p | include xgei-0/2/0/1_
xgei-0/2/0/1 15.1.1.1 255.255.255.0 up up up
可以完美解决这个问题。