Cisco IOS Command Aliases: Make Your Life Easier

 

How many times do you type show ip interface brief, copy run start, configure terminal, show running-config, etc. But isn’t there a way to make thing easier? Yes there is, that’s command aliases facility provided with the Cisco IOS.

Aliases are configured within a mode; exec: #, global configuration: (config)#, interface configuration: (config-if)#, router configuration: (config-router)#, etc. you can issue a show aliases ? command to see how many modes are there. But practically you’ll mostly need exec mode aliases.

A fitered output of the show aliases ? command is shown bellow.

Router#show aliases ?
<--- output omitted --->
  configure                  Global configuration mode
...
  exec                       Exec mode
...
  interface                  Interface configuration mode
...
  router                     Router configuration mode
...
   

The show aliases command in exec mode shows all the aliases configured on the router. By default there are some aliases in the IOS.  

Router#show aliases
Exec mode aliases:
  h                     help
  lo                    logout
  p                     ping
  r                     resume
  s                     show
  u                     undebug
  un                    undebug
  w                     where

 

Syntax for setting an alias is: alias <mode> <alias> <command>. Lets look at an example. Here I’m setting the alias ib in exec mode for the command show ip interface brief. 

Router(config)#alias exec ib show ip interface brief

 

In the following example, I configured the alias rt to show the IPv4 routing table in exec, global configuration, router configuration and interface configuration modes.

 

Router(config)#alias exec rt show ip route
Router(config)#alias configure rt do show ip route
Router(config)#alias interface rt do show ip route
Router(config)#alias router rt do show ip route

 

The first line is quite straight forward. In the preceding line I have used the do command to execute the command following that in the exec mode. You can be creative with this command and it’s up to you to create your own aliases for your convenience. 

Dharshin


Tags:
Good post. I like your

Good post. I like your weblog.

Submitted by utylizacja (not verified) on Fri, 05/30/2008 - 11:40.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Translate

Syndicate

Syndicate content

Subscribe

Subscribe

Recent comments