OS10 Enterprise Edition User Guide Release 10.4.0E(R3)

PDF

Alias command

The alias command allows you to create shortcuts for commonly used or long commands, and execute long commands along with their parameters.

The alias supports the following modes:

  • Persistent mode — The alias is persistent and can be used in other sessions as well. The aliases created in the Configuration mode are persistent.
  • Non-persistent mode — The alias can be used only within the current session. Once the session is closed, the alias is removed from the system. The aliases created in Exec mode are non-persistent.
  • NOTE: You cannot use existing keywords, parameters, and short form of keywords as alias names, nor can you create a shortcut for the alias command.
  • Create an alias in EXEC or CONFIGURATION mode — EXEC mode for non-persistent and CONFIGURATION mode for persistent aliases. The alias value is the actual command where you can use $n to enter the input parameters. You can substitute $n with either numbers ranging from 1 to 9 or with an asterisk (*) and enter the parameters while executing the commands using the alias. Use asterisk (*) to represent any number of parameters. The maximum number of input parameters is 9.
    alias 
                                        alias-name alias-value
                                     
  • Execute the commands using the alias in the respective modes.
  • View the current aliases.
    show alias [brief | detail]
  • Use the no form of the command to delete an alias.
    no alias 
                                        alias-name
                                     
Create alias
OS10# alias showint "show interface $*"
                                 OS10(config)# alias goint "interface ethernet $1"
                              
View alias output for showint
OS10# showint status
                                 ---------------------------------------------------------------------------------
                                 Port            Description     Status   Speed    Duplex   Mode Vlan Tagged-Vlans
                                 ---------------------------------------------------------------------------------
                                 Eth 1/1/1                       up       40G               A    1    -
                                 Eth 1/1/2                       up       40G               A    1    -
                                 Eth 1/1/3                       up       40G               A    1    -
                                 Eth 1/1/4                       up       40G               A    1    -
                                 Eth 1/1/5                       up       40G               A    1    -
                                 Eth 1/1/6                       up       40G               A    1    -
                                 Eth 1/1/7                       up       40G               A    1    -
                                 Eth 1/1/8                       up       40G               A    1    -
                                 Eth 1/1/9                       up       40G               A    1    -
                                 Eth 1/1/10                      up       40G               A    1    -
                                 Eth 1/1/11                      up       40G               A    1    -
                                 Eth 1/1/12                      up       40G               A    1    -
                                 Eth 1/1/13                      up       40G               A    1    -
                                 Eth 1/1/14                      up       40G               A    1    -
                                 Eth 1/1/15                      up       40G               A    1    -
                                 Eth 1/1/16                      up       40G               A    1    -
                                 Eth 1/1/17                      up       40G               A    1    -
                                 Eth 1/1/18                      up       40G               A    1    -
                                 Eth 1/1/19                      up       40G               A    1    -
                                 Eth 1/1/20                      up       40G               A    1    -
                                 Eth 1/1/21                      up       40G               A    1    -
                                 Eth 1/1/22                      up       40G               A    1    -
                                 Eth 1/1/23                      up       40G               A    1    -
                                 Eth 1/1/24                      up       40G               A    1    -
                                 Eth 1/1/25                      up       40G               A    1    -
                                 Eth 1/1/26                      up       40G               A    1    -
                                 Eth 1/1/27                      up       40G               A    1    -
                                 Eth 1/1/28                      up       40G               A    1    -
                                 Eth 1/1/29                      up       40G               A    1    -
                                 Eth 1/1/30                      up       40G               A    1    -
                                 Eth 1/1/31                      up       40G               A    1    -
                                 Eth 1/1/32                      up       40G               A    1    -
                                 --------------------------------------------------------------------------------
                              
View alias output for goint
OS10(config)# goint 1/1/1
                                 OS10(conf-if-eth1/1/1)#
                                 
                              
View alias information
OS10# show alias
                                 Name                 Type
                                 ----                 ----
                                 govlt                Config
                                 goint                Config
                                 shconfig             Local
                                 showint              Local
                                 shver                Local
                                 
                                 Number of config aliases : 2
                                 Number of local aliases : 3
                              
View alias information brief (displays the first 10 characters of the alias value)
OS10# show alias brief
                                 Name                 Type        Value
                                 ----                 ----        -----
                                 govlt                Config      "vlt-domain..."
                                 goint                Config      "interface ..."
                                 shconfig             Local       "show runni..."
                                 showint              Local       "show inter..."
                                 shver                Local       "show versi..."
                                 
                                 Number of config aliases : 2
                                 Number of local aliases : 3
                              
View alias information in detail (displays the entire alias value)
OS10# show alias detail
                                 Name                 Type        Value
                                 ----                 ----        -----
                                 govlt                Config      "vlt-domain $1"
                                 goint                Config      "interface ethernet $1"
                                 shconfig             Local       "show running-configuration"
                                 showint              Local       "show interface $*"
                                 shver                Local       "show version"
                                 
                                 Number of config aliases : 2
                                 Number of local aliases : 3
                              
Delete alias
OS10#  no alias showint
                                 OS10(config)# no alias goint
                              

Rate this content

Accurate
Useful
Easy to understand
Was this article helpful?
0/3000 characters
  Please provide ratings (1-5 stars).
  Please provide ratings (1-5 stars).
  Please provide ratings (1-5 stars).
  Please select whether the article was helpful or not.
  Comments cannot contain these special characters: <>()\