Command Aliases

You can create aliases to execute any ExtremeXOS command, including any options, arguments, and redirection.

For example, you can create an alias called "download" to substitute for "download image 102.3.10.5". Now you can now simply type "download" and then the image file name to download your ExtremeXOS image from the 102.3.10.5 location, instead of typing download image 102.3.10.5 image_name.

Important

Aliases are only available in the shell session in which they are created. When you exit the shell your aliases are lost. To create persistent aliases, you need to add the aliases to the script exshrc.xsf that you must create using the VI editor and save in the /usr/local/cfg folder.

For more information about the exshrc.xsf script, see ExtremeXOS Shell RC Script. For information about managing files on the switch, see Using the ExtremeXOS File System.

To be recognized, the alias must be the first word in the command string typed at the prompt. Substitution does not occur if the alias name string occurs anywhere else.

Auto-completion works for aliases much as it does for ExtremeXOS commands (see Syntax Helper).

Limitations

  • Arguments cannot occur in the middle of alias commands. For example, you cannot create an alias "set_vlan_ip" for the command configure vlan vlan_name ipaddress ip_address where you specify the VLAN name as an argument. This is because aliases work through direct textual substitution.
  • Aliases cannot be chained together. For example, if you create an alias "sh" for show version and another alias "ps" for process, then entering sh ps at the prompt is not equivalent to entering “show version process”.
  • You cannot tab-complete commands when creating an alias by using the alias command.
  • Aliases cannot be created for the current shell session using UPM scripts or Python scripts.
  • Tab completion does not work for commands given inside the aliases.

Usage

To create an alias, use the command alias alias_name command

To view a list of current aliases, use the command alias (with no other arguments).

To display the command that will be substituted for alias_name, use the command alias alias_name.

To delete aliases, use the command unalias.