简介
unalias命令用来取消命令别名,是为shell内建命令。如果需要取消任意一个命令别名,则使用该命令别名作为指令的参数选项即可。如果使用-a选项,则表示取消所有已经存在的命令别名。
在终端关闭或者系统重新启动后都会失效,如果需要永久取消,请修改对应的配置文件。
命令格式
unalias [-a] name [name …]
常用参数
-a | 移除所有的别名设置 |
---|---|
示例
[root@localhost ~]# which --skip-alias ls
/usr/bin/ls
[root@localhost ~]# alias gkdaxue='/usr/bin/ls'
[root@localhost ~]# gkdaxue
test2.txt tr.txt
[root@localhost ~]# alias gkdaxue
alias gkdaxue='/usr/bin/ls'
[root@localhost ~]# unalias gkdaxue
[root@localhost ~]# alias gkdaxue
-bash: alias: gkdaxue: not found