天天看點

linux指令定位到指定位置,linux下whereis指令使用詳解---linux定位檔案位置指令

轉自:http://www.linuxso.com/a/linuxmingling/0/whereis.html

whereis指令是定位可執行檔案、源代碼檔案、幫助檔案在檔案系統中的位置

whereis指令的文法:whereis [-bmsu] [BMS 目錄名 -f ] 檔案名

whereis指令的各選項含義如下:

-b   定位可執行檔案。

-m   定位幫助檔案。

-s   定位源代碼檔案。

-u   搜尋預設路徑下除可執行檔案、源代碼檔案、幫助檔案以外的其它檔案。

-B   指定搜尋可執行檔案的路徑。

-M   指定搜尋幫助檔案的路徑。

-S   指定搜尋源代碼檔案的路徑。

whereis指令例子:

[[email protected] hzl126]# whereis apache2

apache2: /usr/local/apache2

[[email protected] hzl126]# whereis mysql

mysql: /usr/local/mysql

[[email protected] hzl126]# whereis httpd

httpd: /usr/sbin/httpd.event /usr/sbin/httpd.worker /usr/sbin/httpd /etc/httpd /usr/lib/httpd /usr/share/man/man8/httpd.8.gz