Cisco: Making long commands short with aliases

Contributor Icon Contributed by AWfki Date Icon October 11, 2006  
Tag Icon Tagged: Cisco networking

How to configure aliases for frequently used commands.


If you’re like you me you hate typing in long commands over and over… and over… and over.

Instead of typing sh ip int br all the time wouldn’t it be nice to just type sib? You can do it just by configuring an alias.

In configure mode enter:
alias exec sib Show ip Int Brief

hit enter and exit config mode. Now type sib and you should get the output from the show ip interface brief command. Note that the odd capitalization isn’t needed, it’s just a thing I do to help me remember what the alias is doing.

You can pipe it just like you could normally, so sib | i down will show only lines with “down” in the text. If you type sib, add a SPACE and then hit TAB the alias will be expanded to Show ip Int Brief.

You could alias create aliases like:
alias exec sibd Show ip Int Brief | include down *down

That will show you only interfaces that have “down”, some spaces, and “down” again. If you’ve got a router/switch with a hundred or more interfaces this is a quick way to look for the one with the problem.

Alias exec isn’t the only option, it’s also possible to create aliases that only work in config mode or config-interface mode. I don’t use them so you’ll to check Cisco.com for more info.

Cisco configures some aliases by default, you can see them, and any you’ve configured, with the command: show alias

Previous recipe | Next recipe |
 

Viewing 1 Comment

 
close Reblog this comment
blog comments powered by Disqus