Get Details of Running Applications on Terminal

activity-monitorpythonterminal

I have found that using activity monitor I get all the information I need. I now just need a way to access this information via preferably Python or even Bash and Apple Script. I just need to get the information at regular intervals and put it in a log file while my program is running.

Best Answer

The terminal command top will give you a list of running processes biggest ones first. Do man top and you will have a complete explanation of the syntax for your version.

Also of interest might be ps, especially if used in scripts. Run man ps for the details.

So, just to add this will give the initial information without any processes shown:

top -o cpu -O +rsize -s 5 -n 0

Based on the example shown in the man page for top. And this is what it looks like : enter image description here