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...

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM