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

相關文章
相關標籤/搜索