How to display list of running processes Python?

Question:

How to display list of running processes Python with full name and active status?

I tried this command: pgrep -lf python

Asked By: MisterPi

||

Answers:

ps -aux will give all process grep python

ps -aux | grep python
Answered By: harshil9968

Try this command:

ps -ef | grep python

ps stands for process status

Answered By: ettanany

You could also setup a “watch” in a separate window to constantly monitor Python processes as you run a script: watch -n 1 "ps u -C python3". Particularly useful when developing with multiprocessing.

Answered By: Jason

View 1 shows me all threads of python running, I use this for checking for memory leaks:

View 1

ps -ef | grep [P]ython


#  502 14537 14484   0  5:47PM ttys000    0:00.58 /Library/Frameworks/Python.framework/Versions/3.9/Resources/Python.app/Contents/MacOS/Python
#  502 14940 14484   0  5:57PM ttys000    0:00.55 /Library/Frameworks/Python.framework/Versions/3.9/Resources/Python.app/Contents/MacOS/Python

View 2

ps -ef | grep python


#  502 14950 14484   0  5:58PM ttys000    0:00.00 grep python

View 3

ps aux | grep python


# jayrizzo         14957   0.0  0.0 34132060    896 s000  S+    5:58PM   0:00.00 grep python

All 3 variations provide slightly different results.

Answered By: JayRizzo

Try this command

ps -ef | grep python

ps stands for process status

Answered By: Drabmaker
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.