Skip to content
Advertisement

How to list all concurrent python processes in my CLI?

I have opened several terminals in parallel:

JavaScript

And in two of those terminals, I have launched a python file, which includes iterations, to keep the process running.
And I would like to have the list of all python processes running.
When I type:
$ ps -ef | grep python or $ps -elf | grep python
I only get the current terminal:

JavaScript

How could I get a full list of the terminals with the associated python processes ? My end goal is to terminate python processes using python os.subprocess and other libraries.

Advertisement

Answer

To view all current processes execute

ps -ax

-a flag stands for all processes -x will display all processes even those not associated with the current tty

refer here

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement