The unalias Command

The unalias command is used to remove entries from the current user's list of aliases.

Aliases are a convenient feature of Unix-like operating systems that make it possible to launch any command or group of commands, inclusive of any options, arguments and redirection, by merely typing a brief, pre-set string (i.e., sequence of characters) and then pressing the ENTER key. Aliases can be created by using the alias command or by making entries in the appropriate configuration files.

As is the case with the alias command, the unalias command is also built into several of the most commonly used shells, including ash, bash (the default shell on most Linux systems), csh and ksh.

The syntax of unalias is:

unalias [-a] [alias_name(s)]

For example, if a user had an alias named p for the pwd (i.e., present working directory) command, such alias could be removed with the following:

unalias p

unalias removes aliases created during the current login session. It also suppresses permanent aliases; however, they are affected only for the current login session and are restored after the user logs in again.

unalias can simultaneously accept any number of alias names as arguments (i.e., input data). However, it has only one option, -a. This option tells unalias to remove all aliases for the current user for the current shell for the current session, but it likewise does not affect permanent aliases for future sessions.

Created August 1, 2005.
Copyright © 2005 The Linux Information Project. All Rights Reserved.