27 November 2008

cisco include command - the poor cousin of the unix grep

How to use the include command in the cisco routers IOS CLI?

A nice way to use it, is like this:


BB#sh int | inclu DLY|is up|is down
FastEthernet0/0 is administratively down, line protocol is down
MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
Serial0/0 is up, line protocol is up
MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
FastEthernet0/1 is administratively down, line protocol is down
MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
Serial0/1 is up, line protocol is up
MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
Loopback0 is up, line protocol is up
MTU 1514 bytes, BW 8000000 Kbit, DLY 5000 usec,
BB#
BB#sh ip int | inclu is up|is down|Internet address| access list
FastEthernet0/0 is administratively down, line protocol is down
Serial0/0 is up, line protocol is up
Internet address is 10.1.24.1/30
Outgoing access list is not set
Inbound access list is not set
FastEthernet0/1 is administratively down, line protocol is down
Serial0/1 is up, line protocol is up
Internet address is 10.1.34.1/30
Outgoing access list is not set
Inbound access list is not set
Loopback0 is up, line protocol is up
Internet address is 172.30.0.1/24
Outgoing access list is not set
Inbound access list is not set
BB#