Name

alias

Synopsis

    alias [options] [name[='cmd']]

Assign a shorthand name as a synonym for cmd. If =' cmd ' is omitted, print the alias for name; if name is also omitted, print all aliases. If the alias value contains a trailing space, the next word on the command line also becomes a candidate for alias expansion. See also unalias.

These aliases are built into ksh88. Some use names of existing Bourne shell or C shell commands.

    autoload='typeset -fu'
    false='let 0'
    functions='typeset -f'
    hash='alias -t'
    history='fc -l'
    integer='typeset -i'
    nohup='nohup '
    r='fc -e -'
    true=':'
    type='whence -v'

The following aliases are built into ksh93:

    autoload='typeset -fu'
    command='command '
    fc='hist'
    float='typeset -E'
    functions='typeset -f'
    hash='alias -t --'
    history='hist -l'
    integer='typeset -i'
    nameref='typeset -n'
    nohup='nohup '
    r='hist -s'
    redirect='command exec'
    stop='kill -s STOP'
    times='{ {time;} 2>&1;}'
    type='whence -v'

Options

-p

Print the word alias before each alias. Not ksh88.

-t

Create a tracked alias for a Unix command name. The Korn shell remembers the full pathname of the command, allowing it to be found more quickly and to be issued from any directory. If no name is supplied, current tracked aliases are listed. Tracked aliases are the similar to hashed commands in Bash. Korn shell only. ksh93 always does alias tracking.

-x

Export the alias; it can now be used in shell scripts and other subshells. If no name is supplied, current exported aliases are listed. Korn shell only. ksh93

Get Unix in a Nutshell, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.