Linux查找特定程序whereis實(shí)例詳解
Linux 查找特定程序 whereis
whereis 命令主要用于查找程序文件,并提供這個(gè)文件的二進(jìn)制可執(zhí)行文件、源代碼文件和使用手冊(cè)存放位置。
1、查找命令程序
例如,查找 touch 命令
[root@node1 /]# whereis touch touch: /usr/bin/touch /usr/share/man/man1/touch.1.gz
執(zhí)行效果如下:
如果只需要查找 touch 命令的二進(jìn)制文件,可以使用 -b 選項(xiàng)實(shí)現(xiàn):
[root@node1 /]# whereis -b touch touch: /usr/bin/touch
效果如下:
2、查找應(yīng)用程序
例如,查找 nginx 服務(wù)
[root@node1 /]# whereis nginx nginx: /usr/sbin/nginx /usr/lib64/nginx /etc/nginx /usr/share/nginx /usr/share/man/man8/nginx.8.gz
查找 java
[root@node1 /]# whereis java java: /usr/java/jdk1.8.0_191/bin/java /usr/local/jdk1.8.0_191/bin/java
如果查詢的程序不存在,則返回一個(gè)空字符串。
例如,查找 hello 程序
[root@node1 /]# whereis hello hello:
以上就是本次介紹的全部相關(guān)知識(shí)點(diǎn),感謝大家的學(xué)習(xí)和對(duì)本站的支持。
版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請(qǐng)保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非www.sddonglingsh.com所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場,如有內(nèi)容涉嫌侵權(quán),請(qǐng)聯(lián)系alex-e#qq.com處理。