View real-time system statistics with top


The top command is a great way to keep track of processes executing on a system in real-time.

Launch top by entering this on the command line.

Here is an example of what you will see.

The ‘-d delay‘ option will change the amount of time between updates.
This will set the delay for half a second.

The ‘-n iterations‘ option allows you to define the number of iterations it displays before it exits. It is handy when you want to see a single snapshot of the system. To do this, enter this command.

The ‘-u user‘ option allows you to view the processes of a single user

The ‘-p PID‘ option shows you a specific process or group of processes by listing their process IDs.

By default top is launched in interactive mode. In this mode you can submit commands that will change the behavior of the program.

Pressing ‘f‘ will allow you to select what fields to display.
You will see a screen similar to this.

Similarly, ‘o‘ will allow you to change the order of the fields that are currently displayed.

If you have multiple CPUs or processor cores the pressing ‘1‘ will give you more individual information on each one.

You can exit by pressing Ctrl-C.