Linux命令搜索命令whereis與which的區(qū)別
Linux命令搜索命令whereis與which的區(qū)別
一 whereis
1、語法
whereis 命令名
搜索命令所在的路徑以及幫助文檔所在的位置
選項:
-b:只查找可執(zhí)行文件
-m:只查找?guī)椭募?br />
2、實戰(zhàn)
[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
二 which
1、語法
which 命令名
搜索命令所在路徑及別名
2、實戰(zhàn)
[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
三 PATH環(huán)境變量
定義的是系統(tǒng)搜索命令的路徑
[root@localhost ~]# echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
以上就是Linux命令搜索命令whereis與which的區(qū)別的講解,如有疑問請留言或者到本站社區(qū)交流討論,大家共同進步,感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!
相關文章
CentOS 7.x下的LEMP環(huán)境搭建詳細教程
我們常說的LNMP環(huán)境是指Linux/nginx/MySQL/PHP組合,LEMP包是由Linux、nginx、MariaDB/MySQL和PHP組成的,那么看來LEMP和LNMP是一樣的,而現(xiàn)在業(yè)內(nèi)習慣性的稱作LEMP。這篇文章主要介紹了CentOS 7.x下的LEMP環(huán)境搭建詳細教程,需要的朋友可以參考下2016-10-10window與linux項目部署之linux文件路徑不存在問題
小編在一次項目測試中,發(fā)現(xiàn)一些bug,window與linux項目部署-linux文件路徑不存在問題,本文給出了解決方案,需要的朋友可以參考下2019-11-11Linux系統(tǒng)(CentOS7安裝)安裝JDK8的教程詳解
這篇文章主要介紹了Linux系統(tǒng)(CentOS7安裝)安裝JDK8的教程,本文給大家介紹的非常詳細,具有一定的參考借鑒價值,需要的朋友可以參考下2020-01-01Apache的Rewrite設置多域名301跳轉(zhuǎn)到主域名的方法
這篇文章主要介紹了Apache的Rewrite設置多域名301跳轉(zhuǎn)到主域名的方法,包括重寫規(guī)則中問號匹配問題的解決,需要的朋友可以參考下2016-06-06