Cisco IOS – finding lines in the running-config

3 01 2007

A few people I know have come across this, but not everyone. If you’ve used the “more” command on a unix machine, you may be familiar with some of this.

When you do a “show running-config” or a “write terminal” to put list the running configuration on the CLI, there are a few ways to refine what you are looking for:

1. Do a “show run” – when the first page of the config appears and hit the “/” key to enable search mode. At the bottom of the screen you will see the cursor blinking. Enter the text you are looking for – for example, “router ospf” and it will whizz you down to the first instance of that string in the running configuration.

2. Doing a “show run int fa0/1” will show you just the config for fa0/1

3. Doing a “show run |begin router” will show you the running config, but starting from the first occurrence of the string “router”. Useful if you have a 6509 that is doing routing and is chock-full of 48-port cards!

Note that the when you use “|begin” or the slash, you are doing a case-sensitive match on a text file. Hence if you were to type “|begin Router” you would not get any matches.

Advertisements

Actions

Information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: