我使用過的Linux命令之whereis – 尋找命令的位置

來源:互聯網
上載者:User

本文連結:http://codingstandards.iteye.com/blog/986891   (轉載請註明出處)

 

用途說明

whereis命令用來尋找命令的位置,包括執行檔案、原始碼和手冊頁檔案(locate the binary, source, and manual page files for a command)。如果要尋找任意檔案的所在位置,可以使用locate或者find等命令。

 

常用參數

格式:whereis <command>

尋找指定命令<command>的位置,包括執行檔案、原始碼和手冊頁檔案。

 

格式:whereis -b <command>

只尋找指定命令<command>的執行檔案位置。

 

格式:whereis -m <command>

只尋找指定命令<command>的手冊頁檔案所在位置。

 

格式:whereis -s <command>

只尋找指定命令<command>的原始碼所在位置。

 

使用樣本樣本一

[root@jfht ~]# whereis whereis
whereis: /usr/bin/whereis /usr/share/man/man1/whereis.1.gz
[root@jfht ~]# whereis -b whereis
whereis: /usr/bin/whereis
[root@jfht ~]# whereis -m whereis
whereis: /usr/share/man/man1/whereis.1.gz
[root@jfht ~]# whereis -s whereis
whereis:
[root@jfht ~]#

 

樣本二

[root@jfht ~]# whereis mysql
mysql: /usr/bin/mysql /usr/lib/mysql /usr/include/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz
[root@jfht ~]# whereis -b mysql
mysql: /usr/bin/mysql /usr/lib/mysql /usr/include/mysql /usr/share/mysql
[root@jfht ~]# whereis -m mysql
mysql: /usr/share/man/man1/mysql.1.gz
[root@jfht ~]# whereis -s mysql
mysql:
[root@jfht ~]#

 

問題思考相關資料

【1】程式人生 Linux whereis 命令

http://www.chengxurensheng.com/htm/2011/2/808.htm

【2】方寸心間 一路走,十年不回頭 linux whereis 命令詳解

http://www.cnblogs.com/wllyy189/archive/2008/04/09/1144131.html

【3】Linux安全線上 linux whereis命令參數及用法詳解---linux定位檔案位置命令

http://www.linuxso.com/command/whereis.html
【4】酷勤 Linux的五個尋找命令:find,locate,whereis,which,type

http://www.kuqin.com/linux/20091009/70532.html

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.