I\'d like to know if it\'s possible to find out the \"command\" that a PID is set to. When I say command, I mean what you see in the last column when you run the command \"t
PLEASE, do not use /proc filesystem in production code. Instead, use well-defined POSIX interfaces, such as glibc calls and standard shell commands! Make the Linux world more standardized, it really needs to!
What you need is well achieved by invoking a shell command
ps -p -o cmd h
No parsing is needed!
Let alone that reading shell command output from python takes no more effort than reading from a file in /proc. And this makes your program more portable, either!