ShenLei
ShenLei

Reputation: 587

How to determine which script that python is executing?

There is an old Python web service running on linux server. I have the pid=12345, the script path is relative and there are many scripts with the same path name. How to determine which one is used by this web service (pid=12345) ?

eg:

# ps aux | grep 12345
www  12345  0.0  0.0 497952  1096 ?   S    Jan09   0:12 python ../www/server.py --port=20321 --mode=0 --processes=2 --threads=10 --logdir=./log/

# locate www/server.py
path_01/www/server.py
path_02/www/server.py
... a lot of files

Upvotes: 1

Views: 61

Answers (1)

ddor254
ddor254

Reputation: 1628

just do sudo pwdx <your_pid> in your case sudo pwdx 12345 and you will get the full path.

Upvotes: 1

Related Questions