step1. 查找出服务的进程id

ps aux|grep nginx
root 1231 0.0 0.0 46336 956 ? Ss 04:21 0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
nginx 1232 0.0 0.2 46808 2144 ? S 04:21 0:00 nginx: worker process
root 1247 0.0 0.0 112660 972 pts/0 R+ 04:56 0:00 grep --color=auto nginx

step2. 通过进程id找到文件位置

ls -l /proc/1231/exe

这里的1231就是之前查找到的进程id,显示如下

lrwxrwxrwx. 1 root root 0 Nov 6 04:24 /proc/1231/exe -> /usr/sbin/nginx
GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:3 个月前 )
186a802e added ecosystem file for PM2 4 年前
5def40a3 Add host customization support for the NodeJS version 4 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐