I need to get a list of all possible running processes(whether they are stopped currently or not) from the system, without keeping a record myself.
I was wondering if there is a better way to get a list of these processes in python without having to do the dreaded subprocess output parsing of an initctl list call.
You can go through
/proc/<pid>/cmdlineto get the running process names. You need to list the files in/procand filter the numerical ones for getting access to list of the processes running on your system.However I wouldn’t call this accessing “all possible running processes” because that would include kernel threads as well.