Linux Command alias, unalias, aliasunalias
1. Alias
Linux alias: 1. Simplified special long commands and parameters 2. Added default options for some commands to improve security.
2. Use alias
[www@work sh]$ alias lm='ls -l | more'[www@work sh]$
The lm command will be added and the ls-l | more command will be executed. Add the-I parameter to the rm command to prevent accidental file deletion.
$ alias rm='rm -i'
View All aliases
www@work sh]$ aliasalias ll='ls -l --color=tty'alias lm='ls -l | more'alias ls='ls --color=tty'alias rm='rm -i'alias vi='vim'alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'[www@work sh]$
Exiting the current session will expire. To save permanently, you can write ~ /. Bashrc.
3. Cancel alias unalias
Remove the alias and use unalias.
[www@work sh]$ unalias lm
Address: http://blog.csdn.net/yonggang7/article/details/40709395
The new linux class has a command: alias
Alias unalias is an internal bash command.
First, the system itself has the dir command (not an alias). When you set the ls alias to dir, the system will first call ls instead of dir, unalias, resume calling the original dir command, while the output of the dir command is not stained.
Second, similarly, mkdir is not an alias but does have its command. You can use which mkdir to query
If you do not know whether a command is an alias or actually exists, use the which command to check whether the command exists.
How does one delete a command alias in linux?
Use unalias to add an alias and delete it directly
Syntax: unalias [-a] [alias]
Parameter-a indicates deleting all aliases. Be careful.