alias - Define or display aliases

The alias utility defines an alias name that has the specified value. If only name is specified, qsh displays the name and value of the alias.

Synopsis

alias [ -p ] [ name [ =value ] ... ]

Description

When no arguments are specified, qsh displays a list of all the aliases and their values.

qsh defines these default aliases:
  • float='declare -E'
  • functions='declare -f'
  • integer='declare -i'

Options

-p
Precede each line of the output with the word "alias " so it is displayed in a re-enterable format.

Operands

Each name specifies an alias in the current environment. If a value is also specified, then the value of the alias is updated.

Exit status

  • 0 when successful.
  • >0 when unsuccessful. The value is the number of names that are not aliases.
Examples
  1. Define an alias to list the contents of a directory:
    
    alias ll='ls -l'
    
  2. Display the value of the ll alias:
    
    alias ll
    
  3. Display the values of all currently defined aliases:
    
    alias