O'Reilly logo

Mac OS X for Unix Geeks by Brian Jepson, Ernest E. Rothman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. System Management Tools

Mac OS X comes with many tools for tweaking and spying on various aspects of your system, including memory, kernel modules, and kernel state variables. Some of these tools come directly from BSD, while others are unique to Mac OS X. Most of the BSD-derived utilities have been filtered through Mach and NeXTSTEP on their way to Mac OS X.

For more details on any of these utilities, see their respective manpages.

Diagnostic Utilities

Mac OS X includes many diagnostic utilities that you can use to monitor your system and investigate problems.

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).

Sample output from top

Figure 8-1. Sample ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required