The “do” Command

Don’t you just hate it when your in the middle of implementing a new configuration but then decide you’d like to issue a “show” or “ping” command so you drop down to privileged EXEC mode? For example:

You could always use “Control” + “Z”, however, you still lose your current “spot” in your configuration hierarchy. In the example above, in order to get back to your original configuration mode, you’d need to issue the following commands:

If you need to do this several times, for example, to test ping connectivity, it can be quite time consuming. To save time you could employ the use of the “do ping” command, as per the example below:

Another example would be the “do show run” command to verify that you have the correct configuration on an interface:

The only downfall of the “do” command is that it does not let you use the “?” or “TAB” button to assist you in completing/finding a command. For example:

As per the above, it says valid commands are invalid. However, if you know that they are correct, you can issue them anyway and the device will give you the correct output. The reason why this is a downfall is because if you cannot remember the command’s syntax, you’ll need to drop down to the privileged EXEC mode.

As always, if you have any questions or have a topic that you would like me to discuss, please feel free to post a comment at the bottom of this blog entry, e-mail at will@oznetnerd.com, or drop me a message on Twitter (@OzNetNerd).

Note: This website is my personal blog. The opinions expressed in this blog are my own and not those of my employer.

Leave a Reply