alias

Use alias to configure a command alias.

Use undo alias to remove a command alias.

Syntax

alias alias command

undo alias alias

Default

The system defines a set of command aliases, as listed in Table 1.

Table 1: System-defined command aliases

Alias

Command string

access-list

acl

end

return

erase

delete

exit

quit

hostname

sysname

logging

info-center

no

undo

show

display

write

save

Views

System view

Predefined user roles

network-admin

mdc-admin

Parameters

alias: Specifies an alias, a case-sensitive string of 1 to 20 characters. An alias cannot be alias or contain spaces.

command: Specifies a command string. Make sure the command string meets the syntax requirements.

Usage guidelines

You can configure an alias for a command or the starting keywords of commands, and use the alias to execute the command or commands.

For example, if you configure the alias siprt for display ip routing-table, you can enter siprt to execute the display ip routing-table command. If you configure the alias ship for display ip, you can use ship to execute all commands starting with display ip:

The command string can include up to nine parameters. Each parameter starts with the dollar sign ($) and a sequence number in the range of 1 to 9. For example, you can configure the alias shinc for the display ip $1 | include $2 command. Then, to execute the display ip interface | include GigabitEthernet0/0/1 command, you only need to enter shinc interface GigabitEthernet0/0/1.

Examples

# Configure the alias shiprt for the display ip routing-table command and verify the configuration.

<Sysname> system-view
[Sysname] alias shiprt display ip routing-table
[Sysname] shiprt
Destinations : 12        Routes : 12
Destination/Mask   Proto   Pre Cost        NextHop         Interface 
0.0.0.0/32         Direct  0   0           127.0.0.1       InLoop0 
3.3.3.3/32         Static  60  0           192.168.1.62    GE0/0 
127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0 
127.0.0.0/32       Direct  0   0           127.0.0.1       InLoop0 
127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0 
127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0 
169.254.0.0/24     Direct  0   0           169.254.0.188   GE0/0 
169.254.0.0/32     Direct  0   0           169.254.0.188   GE0/0 
169.254.0.188/32   Direct  0   0           127.0.0.1       InLoop0 
169.254.0.255/32   Direct  0   0           169.254.0.188   GE0/0 
192.168.57.0/24    RIP     100 1           192.168.1.62    GE0/0 
224.0.0.0/4        Direct  0   0           0.0.0.0         NULL0 
224.0.0.0/24       Direct  0   0           0.0.0.0         NULL0 
255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0

# Configure the alias shinc for display ip $1 | include $2.

[Sysname] alias shinc display ip $1 | include $2

# Use the alias shinc to display all static routes.

[Sysname] shinc routing-table Static
3.3.3.3/32         Static  60  0           192.168.1.62    GE0/0

# Use the alias shinc to display all RIP routes.

[Sysname] shinc routing-table RIP
192.168.57.0/24    RIP     100 1           192.168.1.62    GE0/0

Related commands

display alias