linux查找文件利器

查找文件

好比:找nginx.conf配置文件nginx

locate nginx.conf
/usr/local/etc/nginx/nginx.conf
/usr/local/etc/nginx/nginx.conf.default

若是提示  locate  命令找不到  就安装下 测试

安装:yum  -y install mlocate

安装完再尝试用locate定位内容,发现依然很差使,报了新的错误:
locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory

更新库:updatedb

查找进程相关

ps aux|grep nginx

ps -ef|grep nginx

2者没有太大的差异。一个样其实

查找nginx的启动的时候的配置文件spa

/usr/local/opt/nginx/bin/nginx -t
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful

测试可知,nginx的配置文件路径为:/usr/local/etc/nginx/nginx.conf 且调用有效。code

相关文章
相关标签/搜索