以 CentOS 7 为例
方式一
使用whereis
指令
whereis nginx
方式二
1、查找已安装的软件并复制软件名(这里为bt-nginx122.x86_64
)
yum list installed | grep nginx
Repository epel is listed more than once in the configuration
bt-nginx122.x86_64 1.22.0-1.el7
2、rpm查找软件的安装路径(-q 表示询问模式,-l 表示返回列表)
rpm -ql bt-nginx122.x86_64
# 输出
/etc/init.d/nginx
/www/server/nginx
/www/server/nginx/conf
/www/server/nginx/conf/enable-php.conf
/www/server/nginx/conf/fastcgi.conf
/www/server/nginx/conf/fastcgi.conf.default
......