alias

alias <ALIAS-NAME> <COMMAND-STRING>

no alias <ALIAS-NAME><COMMAND-STRING>

Description

Defines an alias for one or more CLI commands. The alias and its definition are valid only for the user that creates the alias.

The alias name cannot be an existing token name.

The no form of this command removes the specified alias.

Parameter

Description

<ALIAS-NAME>

Specifies the name of the alias you are defining.

<COMMAND-STRING>

Specifies one or more commands and their parameters. Separate commands with a semicolon (;). Length: 1 to 400 characters.

For commands that require user-supplied parameters, use $1 through $n, in order, as placeholders. These parameters are replaced by the corresponding arguments from the command line, and must match the number of parameters required by the original command. For alias definitions that include multiple commands, continue numbering parameters through all commands. Do not restart numbering for each command.

Examples

Defining an alias:

switch(config)# alias srci show running-config interface $1 switch(config)# srci? shv Execute "show alias" to list the command list. Arguments to replace $1, $2 etc. switch(config)# show alias Alias Name Alias Definition ------------------------------------------------------------------------------- srci show running-config interface $1

Using alias in config context:

switch(config)# srci 1/1/1 interface 1/1/1 no shutdown ip address 1.1.1.1/24 exit

Using alias in enable context:

switch# srci 1/1/1 interface 1/1/1 no shutdown ip address 1.1.1.1/24 exit

Using alias in operator context:

switch> srci 1/1/1 interface 1/1/1 no shutdown ip address 1.1.1.1/24 exit

Removing an alias:

switch(config)# no alias srci show running-config interface $1 switch(config)# show alias Alias Name Alias Definition -------------------------------------------------------------------------------

Command History

Release

Modification

10.07 or earlier

--

Command Information

Platforms

Command context

Authority

All platforms

config

Administrators or local user group members with execution rights for this command.