top
The top utility displays memory statistics and a list of running processes. It is divided into two regions: the top region contains memory statistics and the bottom region contains details on each process.
Tip
The Mac OS X version of top is based on the one used in early versions of BSD. It was ported to Mach in 1988, to NeXTSTEP in 1990, and to Mac OS X in 1999.
You can specify the number of processes to show by supplying a numeric argument. By default, top refreshes its display every second and sorts the list of processes by process ID (PID) in descending order. You can set top to sort by CPU utilization with -u, and you can specify the refresh delay with the -s option. Figure 8-1 shows the output of top -u 10 (if you wanted to refresh the output every 3 seconds, you could run top -s3 -u 10).
Table 8-1 describes the values shown in the top region, and Table 8-2 describes the columns in the bottom region (process information).
Item number |
Item |
Description |
1 |
Processes |
The number of processes and threads. A running process is currently using CPU time, while a sleeping process is not. |
2 |
Load Avg. |
The average system load (number of jobs vying for the CPU’s attention) over the last 1, 5, and 15 minutes. |
3 |
CPU usage |
A breakdown of CPU usage, listing time spent in
|
Get Mac OS X for Unix Geeks now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.