Possible Duplicate:
Finding the command for a specific PID in Linux from Python
I currently have a python process (and its pid, of course) and I wondered if it is possible to find out which script this process is running. (I use Ubuntu Linux 10.04.4 LTS)
cat /proc/${pid}/cmdline | tr '\0' ' '
The cmdline
pseudo-file contains a process's command line arguments as a NUL-separated list of strings. The tr
command translates the NULs to spaces.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With