Basic Operation Guide 2014/02

Example 22 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.
Example 23 Alias commands and their configurations
HP Switch(config)# show alias
Name Command
------------ ------------------------------
sc show config
sic show int custom 1-4 port name: 4 type vlan intrusion
speed enabled mdi
CLI shortcut keystrokes
FunctionsKeystrokes
Jumps to the first character of the command line.[Ctrl] [A]
Moves the cursor back one character.[Ctrl] [B] or ‘
Terminates a task and displays the command prompt.[Ctrl] [C]
CLI control and editing 39