網頁

2009年8月21日 星期五

2009.8.21 show command還可以這樣用:用括弧,然後再搭配or

今天在研究某件事, 從書上看到show的指令後面的參數的括號用法
一般人只會用show run, 再去找你要的
進階一點會用:
show run route
show run | inc ip route    縮小範圍去看static route的設定就好
再來是超人才知道的用法, 可以用括弧,然後再搭配or, 如下:



show interface | inc (line protocol | Hardware), 可以只顯示有protcol or hardware字串行出來.
(show int | inc (line protocol | Hardware), 可以只顯示有protcol or hardware字串行出來)

也可以這樣子:

xxxx-6509-1#sh cdp neigh detail | inc (Device ID|IP address|Interface)
Device ID: rw2960
  IP address: 10.141.10.11
Interface: GigabitEthernet8/16,  Port ID (outgoing port): GigabitEthernet0/1
  IP address: 10.141.10.11
Device ID: cses2924
  IP address: 10.141.16.11
Interface: FastEthernet3/8,  Port ID (outgoing port): FastEthernet1/2
Device ID: ms2950-1
  IP address: 10.141.11.11
Interface: GigabitEthernet8/17,  Port ID (outgoing port): FastEthernet0/1
Device ID: 345kv-2924
  IP address: 10.141.200.186
Interface: FastEthernet3/5,  Port ID (outgoing port): FastEthernet1/1
Device ID: sc3524
  IP address: 10.141.2.11
Interface: GigabitEthernet1/7,  Port ID (outgoing port): GigabitEthernet0/1

沒有留言:

張貼留言

追蹤者