I figure out how to use the pipe symbol to form "AND" operator, such as show cdp nei | ex Gig|VMware (exclude BOTH Gig AND VMware keywords).
However, does anyone know how to use the pipe or other symbol to form "OR" and "NOT" operators?
The output of CLI commands can be modified using regular expressions. Here is a URL that describes how to use them. http://www.cisco.com/en/US/docs/ios/12_0t/12_0t1/feature/guide/cliparse.html#wp6028
I took the output of "show ip interface brief", which listed a bunch of different interfaces on my 2800 router, including Loopback0 and Tunnel0 interfaces.
To test the "or" I used another pipe between the two terms that I want to "or", which in this case is Loopback or Tunnel. After the "or" I only want to see the Tunnel interface, so I just include that from the output of the prior selection for Loopback or Tunnel.
router#sh ip int brief | include Loopback|Tunnel | include Tunnel
Tunnel0 126.96.36.199 YES NVRAM administratively down down
To use a "NOT" condition I just use the "exclude" after whatever selection I chose prior to the exclude. In this case, I first chose Loopback or Tunnel. From that output I excluded Tunnel so that I only have Loopback in my output.
router#sh ip int brief | include Loopback|Tunnel | exclude Tunnel
Loopback0 188.8.131.52 YES NVRAM up up