Searching for specific text using linenum and includes By David Bombal
Saturday, March 06, 2010 11:10:01 PM
Here we are combining two powerful IOS commands to save time when searching for text.
If you want to learn more about the individual commands, please get download our "Cool IOS Commands" EBook from http://www.ConfigureTerminal.com/Cool_IOS_Commands.html
In this example, we are looking to see if a dial-peer with a destination pattern of 1000 has been created, and we want to see what dial-peer number it is using. The first command we will use is:
show run linenum | include 1000
This will display the text with the destination pattern as follows:
Router#show run linenum | include 1000
254 : destination-pattern 1000
280 : number 1000
306 : scheduler allocate 20000 1000
We can see that the destination pattern command is on line 254. Now we can do a show run starting with line number 253:
Router#show run linenum | begin 253
253 : dial-peer voice 1321 voip
254 : destination-pattern 1000
255 : session target ipv4:10.1.1.6
Thus we can see that the dial peer number used is 1321.
There are many cases where this can be used; another example would be with IPSec crypto maps or ISAKMP policies.
These commands can be used in many cases to save time when searching for text.