To run top, simply enter the command:
This will display the top few processes (sorted by CPU usage). The display is updated periodically (default is every 3 seconds) to ensure the info displayed is up to date. This page refresh rate can be controlled by hitting either d or s and entering the number of seconds you wish to use.
To highlight the values in the summary aread, hit B (that is for Bold).
Saving your changes
Before continuing any further with customising top's look and feel for your purposes, be aware that you must save any changes otherwise top will discard them when you exit (exit by typing q).
To save any changes you make just hit W.
Tweaking the summary area
The first area to the top of the screen while viewing the top program is called the summary area.
You can toggle which bits of this are included in the display.
- To toggle the showing of load average and uptime, hit l.
- To toggle memory and swap space information, hit m.
- To toggle task data and cpu state information, hit t.
- To toggle showing each cpu, hit 1.
Different display types
There are four display types (where each display type shows different column fields, column ordering, and sort field).
The default display type is 1. To change the display type, hit G followed by the number (1 - 4).
These are the column headers available in each display mode:
Mode 1 will show the following columns in the display:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
Mode 2 will show:
PID PPID TIME+ %CPU %MEM PR NI S VIRT SWAP RES UID COMMAND
Mode 3 will show:
PID %MEM VIRT SWAP RES CODE DATA SHR nFLT nDRT S PR NI %CPU COMMAND
Mode 4 will show:
PID PPID UID USER RUSER TTY TIME+ %CPU %MEM S COMMAND
There is an "Alternate Mode" that you can use which shows the top few from each display type/mode. To use the alternate mode just hit A.
Sort related options
You can change which field gets used for the sort order by hitting F or O. The following options are available:
Choose one by hitting the appropriate letter, then hit return.
The sort order itself can be changed (that is largest to smallest -> smallest to largest) by hitting R.
Also, you can highlight the column of the field used for sorting by hitting x
Tweaking the task area
To toggle the showing of the command line options used to start the applications, hit c.
To toggle whether to show threads or not, hit H.
The use of cumulative time (total cpu time used by the process and its dead children) can be turned on by hitting S.
You can toggle colour on/off by hitting z
You can change the colours used by top by hitting Z. You'll be shown the options as per the image below:
Simply hit the letter for the target area you want to change the colour of, then hit the number of the colour.You can save your changes immediately (by hitting a or w), or afterwards by hitting before you exit top.
This is a quick reference as per man page.
bold summary headings
choose 1-4 to get different displays
write current settings to its config file.
Tweak summary area