Cisco CLI Alias Tricks

I have used the alias command on both the Cisco IOS and Nexus platforms to shorten long commands. For example, I use the alias ‘sisi’ for the command “show interface status | include”.

NX-OS deprecated many of the legacy commands that IOS still contains. One of these deprecated commands is the “write terminal” command. I have worked on Cisco routers for a while and originally learned to use ‘wri’ (I use three letters to avoid mistakes between ‘show’ and ‘shutdown’) to save my configurations instead of “copy run start”. On the Nexus platform the ‘write terminal’ command is one of those deprecated commands. However, with an alias you can put this legacy command back in the CLI. In fact, this is one of the first commands I put in any Nexus that I work on. Use the alias ‘cli alias name wri copy run start’.

NX-OS allows you to issue show or ping commands while you are in configuration mode. This is extremely help when you need to verify if that the command you just issued fixed the problem. On the IOS platforms you have to use the ‘do’ command in order to execute any exec level commands while in configuration mode. It’s a little annoying that you have to use ‘do’, IMHO. If you create the IOS alias ‘alias configure sho do show’, you will be able to issue show commands within configuration mode. Of course you can substitute the ‘sho’ in that command with whatever your preference of the three variations (sh, sho, show) to issue show commands.

You can do this with more of the exec level commands. Here are a few of the IOS alias that I use:

alias configure sho do show
alias configure ping do ping
alias interface sho do show
alias interface ping do ping