Once a few aliases have been defined, you can manage them in different ways, as shown below:
Command | Description |
% alias | List currently defined aliases |
% alias name | List the definition for the alias name |
% alias | grep pattern | List all definitions that contain pattern |
% \command | Temporarily disable the alias. Use the default command, not the alias by that name |
% unalias name | Disable the alias definition for name for the rest of your UNIX session |
These commands are demonstrated in the following ToolTip: Mouseover the image below to obtain more information.
The user can create aliases in the Korn shell. An alias is a nickname for an existing command or commands.
The real command(s) is substituted for the alias when the shell evaluates the command line.
1 $ alias cl='clear'
2 $ alias l='ls –laF'
3 $ alias ls='ls −aF'
4 $ \ls ..
Explanation:
- The alias cl is an alias for clear.
- The alias is l. The letter l is a nickname for the command ls –laF.
- The alias ls is assigned the command ls –aF.
- The backslash turns off the meaning of the alias for the execution of this line. The real ls command, not the alias, is executed.
Alias Commands
- alias: List all aliases
- alias rm: List a specific alias.
- alias rm rm -i: Define an alias.
- alias | grep rm: List all aliases that match a pattern.
- rm: Temporarily use the default command, not the alias by that name.
- unalias rm: Disable an alias for the rest of the session.
GNU/Linux Options
-7 Strip the eighth bit on input and output.
-b hostalias
Use bind(2) to bind the local socket to an aliased address or
the address of an interface other than the one that would be
chosen by connect(2).
In the next lesson, the display of previous commands using the history feature will be discussed.