zl程序教程

您现在的位置是:首页 >  系统

当前栏目

Linux查找特定程序whereis实例详解

Linux实例程序 详解 查找 特定 whereis
2023-06-13 09:20:05 时间

Linux 查找特定程序 whereis

whereis 命令主要用于查找程序文件,并提供这个文件的二进制可执行文件、源代码文件和使用手册存放位置。

1、查找命令程序

例如,查找 touch 命令


[root@node1 /]# whereis touch

touch: /usr/bin/touch /usr/share/man/man1/touch.1.gz

执行效果如下:

 

如果只需要查找 touch 命令的二进制文件,可以使用 -b 选项实现:


[root@node1 /]# whereis -b touch

touch: /usr/bin/touch

效果如下:

2、查找应用程序

例如,查找 nginx 服务


[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

如果查询的程序不存在,则返回一个空字符串。

例如,查找 hello 程序


[root@node1 /]# whereis hello

hello:

本篇文章到此结束,如果您有相关技术方面疑问可以联系我们技术人员远程解决,感谢大家支持本站!


我想要获取技术服务或软件
服务范围:MySQL、ORACLE、SQLSERVER、MongoDB、PostgreSQL 、程序问题
服务方式:远程服务、电话支持、现场服务,沟通指定方式服务
技术标签:数据恢复、安装配置、数据迁移、集群容灾、异常处理、其它问题

本站部分文章参考或来源于网络,如有侵权请联系站长。
数据库远程运维 Linux查找特定程序whereis实例详解