There will be times that you set a common command such as
who with a new
definition and then decide you need its old functionality back.
You can quote, or protect, the alias name to temporarily override
the alias, for example, \who.
Or you can permanently regain the old functionality by unsetting
the alias. To unset an alias use the unalias
command. In one of the previous examples who
was set to who | sort.
To unset who,
type:
Then, type alias
and notice from the listing that who
has disappeared from the alias list and now performs it original
function. The results of running who
before and then after should look something like this:
$ who mary tty02 Sep 24 14:19 michael tty04 Sep 24 09:41 nick tty01 Sep 24 09:41 $ unalias who $ who nick tty01 Sep 24 09:41 mary tty02 Sep 24 14:19 michael tty04 Sep 24 09:41 $ |
The POSIX and Korn Shells default aliases (i.e., false,
integer, ...) can be unset
or redefined, as well. The POSIX Shell also provides the -a
option with the unalias
built-in command. This option can be used to remove all the alias
definitions by typing, at the shell command line prompt: