linux query running program directory

Want to find where msgcenter-sms is running

$ ps aux | grep msgcenter-sms
souche   18118  0.0  1.0 1165052 44196 ?       Ssl  Jan14   0:01 node /home/souche/msgcenter-sms/node_modules/egg-scripts/lib/start-cluster {"title":"msgcenter-sms","baseDir":"/home/souche/msgcenter-sms","framework":"/home/souche/msgcenter-sms/node_modules/@souche/blue-windy"} --title=msgcenter-sms
souche   27554  0.0  0.0  13232   928 pts/0    S+   23:14   0:00 grep --color=auto msgcenter-sms

The path has been given here /home/souche/msgcenter-sms/node_modules/egg-scripts/lib/start-cluster, but this path is actually just the startup script. If you start with the global command, there is no way to display the path. In short, I got a pid of 18118

$ cd /proc/18118
/proc/18118$ ls -l  cwd
lrwxrwxrwx 1 souche souche 0 Jan 15 23:14 cwd -> /home/souche/msgcenter-sms

You're done, the program directory is actually in / home / souche / msgcenter-sms.

Guess you like

Origin www.cnblogs.com/everlose/p/12724521.html