源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

Linux命令搜索命令whereis与which的区别

  • 时间:2020-09-17 07:07 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:Linux命令搜索命令whereis与which的区别
[b]Linux命令搜索命令whereis与which的区别[/b] [b]一 whereis[/b] 1、语法 [b]whereis 命令名[/b] 搜索命令所在的路径以及帮助文档所在的位置 选项: -b:只查找可执行文件 -m:只查找帮助文件 [b]2、实战[/b]
[root@localhost ~]# whereis ls
ls:/usr/bin/ls /usr/share/man/man1/ls.1.gz/usr/share/man/man1p/ls.1p.gz
[root@localhost ~]# whoami
root
[root@localhost ~]# whatis
whatis what?
[root@localhost ~]# whatis ls
ls (1)- list directory contents
ls (1p)- list directory contents
[root@localhost ~]# whereis -b ls
ls:/usr/bin/ls
[root@localhost ~]# whereis -m ls
ls:/usr/share/man/man1/ls.1.gz/usr/share/man/man1p/ls.1p.gz
[b]二 which[/b] 1、语法 which 命令名 搜索命令所在路径及别名 2、实战
[root@localhost ~]# which ls
alias ls='ls --color=auto'
/usr/bin/ls
[root@localhost ~]# which pwd
/usr/bin/pwd
[root@localhost ~]# whereis cd
cd:/usr/bin/cd /usr/share/man/man1/cd.1.gz/usr/share/man/man1p/cd.1p.gz
[root@localhost ~]# which cd
/usr/bin/cd
[b]三 PATH环境变量[/b] 定义的是系统搜索命令的路径
[root@localhost ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
以上就是Linux命令搜索命令whereis与which的区别的讲解,如有疑问请留言或者到本站社区交流讨论,大家共同进步,感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部