Looking for a way to peek under your Mac’s hood and see what is happening on (or slowing down) your system? Find out here how to view running Mac processes in macOS Terminal using “top” and “ps”.
First, a Mosquito Comes Along
A mosquito comes along; it proceeds its flight from flower to flower and carries good pollen.
Cocoa plants in particular depend on little midges for fertilization so their female flowers will produce the fruit we then like to consume as hot or cold chocolate.
So, that’s one thing a mosquito does; what’s it your Mac is doing, by the by?
How to View Running Mac Processes in macOS Terminal
Using Top (Updating List)
Time needed: 2 minutes
To see processes running on macOS in a constantly updated list in Mac Terminal:
- Type
top
at the macOS Terminal command prompt.Not in the terminal: You can also view processes in Mac Activity Monitor, of course.
- Press Enter.
- Find running processes listed by CPU usage by default.
- Optional: Change the sort order.
Here’s how: Press O, then type the criterion for sorting and press Enter.
“Top” sorting criteria: Criteria for sorting includecpu
(CPU usage),mem
(physical memory as in Activity Monitor),pid
(process ID),command
(process name),state
(process state) and many criteria more. - Press Q to quit top.
Using Ps (All Processes)
To get a list of processes running on a Mac using ps in macOS Terminal:
- Type
ps -A
at a Terminal prompt. - Press Enter.
Here’s what happens: This will list all running processes for all users on the Mac.
Scrolling the list: You can feed the list to less, of course, to more easily browse it using ps -A | less
.
Sorting: Ps sorts by terminal and process ID by default; use -m
to sort by memory usage and -r
to sort by current CPU usage instead.
More info: Using the -v
option, you can easily include more process information (such as CPU usage); note that processes will be sorted by memory usage by default with this option.
Example: Run ps -Avr | less
to see all processes with extra information sorted by CPU usage in a scrollable list.
How to View Running Mac Processes in macOS Terminal: FAQ
How do I reverse the sort order in top?
By default, top sorts in descending order; to change the sort order, precede the sorting order with +
(plus sign).
Example: O +pid
Enter will sort by process ID starting from the smallest (on top).
Can I scroll the process list in top?
No.
To view a certain kind of processes, sort the list so that they appear on top’s top. To view all processes in a scrollable list (as a one-time snapshot), you can use ps (see above).
Can I end a process in top?
Yes.
To quit a process using top in a Mac Terminal:
- Press Shift S in top.
- Type the termination signal you want to use to quit the process.
Quit: To end a process gently, typeTERM
, the software termination signal.
Force quit: For forcing a process to quit (potentially losing unsaved data), typeKILL
. - Press Enter.
(How to view running Mac processes in Terminal tested with macOS Sonoma 14.6; first published August 2024)