Skip to main content


Discworld player help



Unalias - getting rid of aliases


> unalias <alias>
> unalias pattern <alias>
> unalias all


The unalias command allows you to remove an alias. You can either remove a specific alias (using unalias <alias name>), remove all aliases (unalias all) or unalias everything with a fixed pattern.

Unaliasing by pattern

"unalias pattern" removes all aliases whose name starts with a given pattern. The pattern is a regular expression. We will not go into deep details here of how regular expressions work, but as a basic overview, these are the most common special symbols:

.matches a single letter
*matches zero or more of the previous symbol
+matches one or more of the previous symbol
$matches the end of the string

For example:

"unalias pattern test" will remove alias "test", "testthingy", "testworld" and everything else that starts with test. "unalias pattern test$" will remove alias "test", but not "testest" or "testworld". "unalias pattern t.t" will remove any alias that starts with "tat", "tot", "trt", for example; "test" will not be matched. "unalias pattern t.*t$" will unalias anything that both begins and ends with "t", with any number of characters (including zero!) in between. "unalias pattern a+b" will unalias everything that starts with a number of a's followed by a b, for example an alias aaaaaabc.

You can do a lot more things than this with regular expressions (many examples can be found on the web), but they are beyond the scope of this help file.

A note of warning: it is very easy to accidently unalias more than you had intended when playing with unalias pattern. Use with care!

See Also:

alias, alias tutorial