linux 中创建、查看和取消别名命令

 

1、创建别名命令

[root@localhost test]# pwd
/home/test
[root@localhost test]# abc
bash: abc: command not found...
[root@localhost test]# alias abc=pwd   ## 创建别名命令, abc等价于pwd命令
[root@localhost test]# abc
/home/test

 

2、查看别名命令

[root@localhost test]# abc
/home/test
[root@localhost test]# alias abc    ## 查看别名命令
alias abc='pwd'

 

 

 

3、取消别名命令

[root@localhost test]# abc    ## abc的别名命令为pwd
/home/test
[root@localhost test]# unalias abc   ## 取消abc的别名命令
[root@localhost test]# abc
bash: abc: command not found...

 

posted @ 2022-03-27 22:06  小鲨鱼2018  阅读(1019)  评论(0编辑  收藏  举报