2-1
Command Alias Configuration
Introduction
As the network environment becomes more complex and network products become increasingly
diverse, users always use network devices from several vendors in real networking environments. In
this case, command keywords differences of devices from different vendors greatly increase the
complexity of device configurations by network administrators.
The command alias function can solve this problem. You can replace the first keyword of a command
supported by the switch with your preferred keyword by configuring the command alias function. For
example, if you configure
show
as the replacement of the
display
keyword for each
display
command,
you can input the command alias
show xx
to execute the
display xx
command. In addition, the original
form of the command
display xx
is still effective.
The command alias function well meets the users’ requirements for preferred form of frequently used
commands, and thus facilitates network configurations as well as respects users' usage habits.
Configuring Command Alias
Follow these steps to configure command aliases:
To do…
Use the command…
Remarks
Enter system view
system-view
—
Enable the command alias
function
command-alias enable
Required
Disabled by default, that is, you
cannot configure command
aliases.
Configure command aliases
command-alias mapping
cmdkey alias
Required
Not configured by default.
Display defined command
aliases and the corresponding
commands
display command-alias
Available in any view
z
You can replace only the first keyword of a non-undo command instead of the complete command
with an alias; and you can replace only the second keyword of
undo
commands with aliases.
z
When you input a command alias, the system displays and saves the command in its original
format instead of its alias. That is, you can define and use a command alias but the command is not
saved and restored in its alias.
z
If you press
Tab
after you input the keyword of an alias, the original format of the keyword will be
displayed.
z
When you define a command alias, the
cmdkey
and
alias
arguments must be in complete form.
z
At present, the device supports up to 20 command aliases. In addition, different commands must
be configured with different aliases.