|Purpose:||Remove aliases from the alias list|
|Format:||UNALIAS [/Q /R file... (alias ...)] alias...|
|alias||One or more aliases to remove from memory.|
|file||One or more files from which to read the aliases to be undefined.|
TCC maintains a list of the aliases that you have defined. The UNALIAS command will remove aliases from that list. UNALIAS supports wildcards in the alias name.
For example, to remove the alias DDIR:
To remove all the aliases:
To remove all the aliases that begin with "DD":
You can delete all matching aliases except for those specified by enclosing the exceptions in parentheses. For example, to remove all aliases beginning with "a" except for alias1 and alias2:
unalias (alias1 alias2) a*
If you keep aliases in a file that can be loaded with the ALIAS /R command, you can remove the aliases by using the UNALIAS /R command with the same file name:
unalias /r alias.lst
This is much faster than removing each alias individually in a batch file, and can be more selective than using UNALIAS *. UNALIAS /R accepts all of the alias definition formats you can use in a file for ALIAS /R.
|/Q||Prevents UNALIAS from displaying an error message if one or more of the aliases does not exist. This option is most useful in batch files, for removing a group of aliases when some of the aliases may not have been defined.|
|/R||Read the list of aliases to remove from a file. The file format should be the same format as that used by the ALIAS /R command. You can use multiple files with one UNALIAS /R command by placing the names on the command line, separated by spaces:|
unalias /r alias1.lst alias2.lst
UNALIAS /R will read from stdin if no filename is present and input is redirected.