02-08-2013 07:48 AM - edited 03-16-2019 03:36 PM
I would like to campaign for "grep" support in the Cisco IOS! It would be really awesome to type a command like sh run to get the configs for all dial-peers with a specific session target ip.
---
Posted by WebUser Billy Bryant from Cisco Support Community App
02-08-2013 09:01 AM
You mean like this?
show run | i dial-peer|session-target
?
02-08-2013 01:34 PM
include (or 'i') will include all lines that match the criteria.
section (or 's') will include entire sections that match.
Ex:
sh run | s dial-peer
sh run | i load
It is not quite as powerful as grep... but still very useful.
02-08-2013 02:43 PM
In addition to include and section - begin and exclude can also be used to pipe the output in IOS:
sh run | begin dial-peer <<< it will show output begin from the config from dial-peers
sh ip int brief | exclude unassigned << when you try to do sh ip int brief and intrested in ip info only
Also if you need to get multiple sections:
show run | section dial-peer |dspf - should show only dial-peer and dsp farm configs.
For include with multiple lines Aaron had already posted above.
I think these all should give you a lot of flexibility - when you want to view only a section from show run.
07-05-2017 08:27 AM
For me this was my mistake. I haven't route to do anything.
02-08-2013 03:55 PM
Cisco IOS supports regular expressions. So you don't necessariyly have to use grep/egrep.
10-13-2017 01:25 PM
Hello fb_webuser
GREP is possible to run with show commands by enabling Cisco IOS Shell
try following:
conf t
shell processing full
exit
terminal shell (in exec mode)
now it is possible to run show commands with grep.
for example:
R1-2901#sh ver | grep 'cisco'
Technical Support: http://www.cisco.com/techsupport http://www.cisco.com/wwl/export/crypto/tool/stqrg.html export@cisco.com.
hope this helps :)
Ahsan Rana
11-02-2018 04:28 PM
Thanks!!!
11-03-2018 01:20 AM - edited 11-03-2018 01:22 AM
:-)
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide