Basic Operation Guide 2013/06

Table Of Contents
Creates a shortcut alias name to use in place of a commonly used command. The
alias command is executed from the current config context.
name: Specifies the new command name to use to simplify keystrokes and aid
memory.
command: Specifies an existing command to be aliased. The command must be
enclosed in quotes.
Use the no form of the command to remove the alias.
For example, if you use the show interface custom command to specify the output, you can configure
an alias for the command to simplify execution. It is recommended that you use an alias that does
not have an existing tab completion in the CLI. For example, using an alias that starts with "show"
or "int" would complete to "show" and "interface" respectively when you use the tab completion
function.
Example 25 Using the alias command with show int custom
HP Switch(config)# show int custom 1-4 port name:4 type vlan intrusion speed
enabled mdi
Status and Counters - Custom Port Status
Intrusion
Port Name Type VLAN Alert Speed Enabled MDI-mode
---- -------- ---------- ----- --------- ------- ------- -------
1 Acco 100/1000T 1 No 1000FDx Yes Auto
2 Huma 100/1000T 1 No 1000FDx Yes Auto
3 Deve 100/1000T 1 No 1000FDx Yes Auto
4 Lab1 100/1000T 1 No 1000FDx Yes Auto
HP Switch(config)# alias sic "show int custom 1-4 port name:4 type vlan intrusion
speed enabled mdi"
HP Switch(config)#
HP Switch(config)# sic
Status and Counters - Custom Port Status
Intrusion
Port Name Type VLAN Alert Speed Enabled MDI-mode
---- -------- ---------- ----- --------- ------- ------- -------
1 Acco 100/1000T 1 No 1000FDx Yes Auto
2 Huma 100/1000T 1 No 1000FDx Yes Auto
3 Deve 100/1000T 1 No 1000FDx Yes Auto
4 Lab1 100/1000T 1 No 1000FDx Yes Auto
NOTE: Remember to enclose the command being aliased in quotes.
Command parameters for the aliased command can be added at the end of the alias command
string. For example:
HP Switch(config)# alias sc "show config"
HP Switch(config)# sc status
To change the command that is aliased, re-execute the alias name with new command options.
The new options are used when the alias is executed.
To display the alias commands that have been configured, enter the show alias command.
42 Using the Command Line Interface (CLI)