Site TIPS PAGE🔎 SEARCH  Ξ INDEX  MAIN MENU  UP ONE LEVEL
 OJB's Web Site. Version 2.1. Mac Tip.You are here: tip tips mac owen2 
Tip

Up to OJB's Mac Tips List

Viewing Processes in Terminal

These commands can be used to check whether a particular process (a process is just a program or app... sort of) is running or not, and to find out if any process is using more memory or CPU time than expected. Most importantly, they show the process ID which can be used to manipulate the process with other commands.

It's usually easy to tell what programs are running on your Mac. Just look in the dock and you will see their icons. If you leave icons for programs there all the time you can tell the currently running programs because they have a small black dot next to them. But your machine is doing a lot more than that! Under the surface there are dozens of other programs running - both Mac background programs and Unix utilities.

To see a list of these use the "ps" command. You won't see much until you add the "a" and "x" options for this command, giving "ps -ax". These options show processes (programs) which belong to other users and background processes. Now you can see how busy your machine really is!

To make the file names a bit easier to understand use the "c" option. This shows the program name instead of the complete path. The command is now "ps -axc".

Your machine is even busier than you think. Try adding the "M" option and see the threads that each process uses. Threads are like sub-tasks the main program is running. The command is now "ps -axcM". Note the "M" is upper case. If you want to know how many threads are running try this: "ps -axcM | wc -l". This pipes the output of the process list to the word count command using the line count option. BTW, when I did this my machine was running over 200 threads!

Update 1: The number I mentioned here related to earlier versions of Mac OS X and is a bit outdated. Looking at my modern Mac running Yosemite I now see almost 2,000 threads!

Update 2: Things continue to get better (or worse). On my macOS 13 MacBook Pro there are now over 3,200 threads!



I usually write a blog post about once a week. The latest post can be viewed here: So Unaware: You can make you own choice, but be aware. (posted 2024-11-11 at 17:01:55).
Warning: mysqli_connect(): MySQL server has gone away in /Library/WebServer/Documents/Owen2/Inc/Footer.inc.php on line 59

Warning: mysqli_connect(): Error while reading greeting packet. PID=69730 in /Library/WebServer/Documents/Owen2/Inc/Footer.inc.php on line 59

Warning: mysqli_connect(): (HY000/2006): MySQL server has gone away in /Library/WebServer/Documents/Owen2/Inc/Footer.inc.php on line 59

Warning: mysqli_error() expects parameter 1 to be mysqli, boolean given in /Library/WebServer/Documents/Owen2/Inc/Footer.inc.php on line 60
Could not connect to MySQL: