nmon | vmstat


15.2.2 Top

Top is a command widely used in the Linux operating system. This command displays a continually updating report of system resource usage.

The top portion of the report lists information such as the system time, uptime, CPU usage, physical and swap memory usage, and number of processes. Below that is a list of the processes sorted by CPU utilization.

You can modify the output of top while it is running. If you press an i, top will no longer display idle processes. Press i again to see the idle processes again. Pressing M will sort by memory usage, S will sort by how long the processes have been running, and P will sort by CPU usage again.

In addition to viewing options, you can also modify processes from within the top command. You can use u to view processes owned by a specific user, k to kill processes, and r to renice them.

For more in-depth information about processes, you can look in the /proc file system. In the /proc file system you will find a series of sub-directories with numeric names. These directories are associated with the process IDs of currently running processes. In each directory you will find a series of files containing information about the process.

Figure 15-3 is sample output for issuing the top command.

Figure 15-3 Output of command top
xxxx