Linux命令搜索命令whereis与which的区别
Linux命令搜索命令whereis与which的区别
一whereis
1、语法
whereis命令名
搜索命令所在的路径以及帮助文档所在的位置
选项:
-b:只查找可执行文件
-m:只查找帮助文件
2、实战
[root@localhost~]#whereisls 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 whatiswhat? [root@localhost~]#whatisls ls(1)-listdirectorycontents ls(1p)-listdirectorycontents [root@localhost~]#whereis-bls ls:/usr/bin/ls [root@localhost~]#whereis-mls ls:/usr/share/man/man1/ls.1.gz/usr/share/man/man1p/ls.1p.gz
二which
1、语法
which命令名
搜索命令所在路径及别名
2、实战
[root@localhost~]#whichls aliasls='ls--color=auto' /usr/bin/ls [root@localhost~]#whichpwd /usr/bin/pwd [root@localhost~]#whereiscd cd:/usr/bin/cd/usr/share/man/man1/cd.1.gz/usr/share/man/man1p/cd.1p.gz [root@localhost~]#whichcd /usr/bin/cd
三PATH环境变量
定义的是系统搜索命令的路径
[root@localhost~]#echo$PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
以上就是Linux命令搜索命令whereis与which的区别的讲解,如有疑问请留言或者到本站社区交流讨论,大家共同进步,感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
热门推荐
1 训练狗狗憋尿
2 狗狗追踪训练
3 狗狗训练要多少钱
5 深圳狗狗训练
6 训练狗狗唤回
7 狗狗叫怎么训练
8 狗狗训练班
10 狗狗社会化训练
11 狗狗叫回训练
12 广州狗狗训练学校
13 狗狗训练躺下
14 狗狗随行训练
15 训练狗狗巡回
16 狗狗要怎么训练
17 狗狗喂食训练
18 训练狗狗躺下