Linux whereis命令尋找程式安裝位置

來源:互聯網
上載者:User

功能說明:尋找檔案。

語  法:whereis [-bfmsu][-B <目錄>...][-M <目錄>...][-S <目錄>...][檔案...]
補充說明:whereis指令會在特定目錄中尋找合格檔案。這些檔案的烈性應屬於原始代碼,二進位檔案,或是協助檔案。
參  數:
  -b  只尋找二進位檔案。
  -B<目錄>  只在設定的目錄下尋找二進位檔案。
  -f  不顯示檔案名稱前的路徑名稱。
  -m  只尋找說明檔案。
  -M<目錄>  只在設定的目錄下尋找說明檔案。
  -s  只尋找原始代碼檔案。
  -S<目錄>  只在設定的目錄下尋找原始代碼檔案。
  -u  尋找不包含指定類型的檔案。

使用執行個體:
執行個體1:將和**檔案相關的檔案都尋找出來
whereis svn
輸出:
[root@localhost ~]# whereis tomcat
tomcat:
[root@localhost ~]# whereis svn
svn: /usr/bin/svn /usr/local/svn /usr/share/man/man1/svn.1.gz

說明:
tomcat沒安裝,找不出來,svn安裝找出了很多相關檔案

執行個體2:只將二進位檔案 尋找出來
命令:
whereis -b svn
輸出:
[root@localhost ~]# whereis -b svn
svn: /usr/bin/svn /usr/local/svn
[root@localhost ~]# whereis -m svn
svn: /usr/share/man/man1/svn.1.gz
[root@localhost ~]# whereis -s svn
svn:
[root@localhost ~]#

說明:

whereis -m svn 查出說明文檔路徑,whereis -s svn 找source源檔案。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.