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)
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.
cmdline
tr