Creating Unix Aliases
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).