all process list on Linux?

Kragen Sitaker kragen at pobox.com
Wed Dec 5 05:13:22 EST 2001


Brian Lee <senux at senux.com> writes:
> How can I get all processes list on Linux OS? I need PID
> and process name (like the result of ps command).

Look in /proc for the pids, and "/proc/%d/cmdline" % pid for the
command-line that started the process.  /proc/%d/stat also gives you
the command name.

HTH.




More information about the Python-list mailing list