本文連結: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