Is it possible to find out which script is running a python process?

Possible duplicate:
Finding a command for a specific PID on Linux from Python

I currently have a python process (and its pid, of course), and I wondered if it was possible to find out which script this process was running. (I am using Ubuntu Linux 10.04.4 LTS)

+5
source share
1 answer
cat /proc/${pid}/cmdline | tr '\0' ' '

The pseudo file cmdlinecontains process command line arguments as a list of strings separated by zeros. The command trconverts NUL to spaces.

+8
source

All Articles