TOP(1)

NAME
top - display top CPU processes

SYNOPSIS
top

DESCRIPTION
top provides an ongoing look at processor activity. At any time, top displays CPU activity since the last update.

COMMAND-LINE OPTIONS

q   This causes top to refresh without any delay. If the caller has superuser priviledges, top runs with the highest possible priority.

FIELD DESCRIPTIONS
Top displays a variety of information about the processor state. The display is updated every 5 seconds by default.

load averages
    This line displays the three load averages for the system. The load averages are the average number of process ready to run during the last 1, 5 and 15 minutes.

processes
    The total number of processes running at the time of the last update. Also breaks this down into the number of tasks which are running, sleeping, stopped, or zombies.

CPU states
    Shows the percentage of CPU time in user mode, system mode, running niced tasks, and idle. Note that niced tasks are only those whose nice value is negative. Also time spent in niced tasks will also be counted in either system or user time, so the total will appear to be more than 100%.

Mem Displays memory usage, including total available memory, free memory, used memory, shared memory, and memory used for buffers.

Swap
    Shows statistics for swap space, including total swap space, available swap space, and used swap space.

PID The process ID of each task which is running is shown in this column.

USER
    The user name of the task's owner is shown in this column

PRI The priority of the task is shown here

NI  The nice value of the task is shown here. Negative nice values are lower priority.

SIZE
    The size of the task's code plus data plus stack space, in kilobytes, is shown here.

RSS The total amount of physical memory used by the task, in kilobtes, is shown here.

SHRD
    The amount of shared memory used by the task is shown in this column.

ST  The state of the task is shown here. The state is either S for sleeping, D for uninterruptible sleep, R for running, Z for zombies, or T for stopped or traced.

TIME
    The task's CPU time since it started is shown here.

%CPU
    The task's share of the CPU time since the last screen update is shown in this column. This is expressed as a percentage of total CPU time.

%MEM
    The task's share of the physical memory is shown here.

COMMAND
    The task's command name is shown here.

INTERACTIVE COMMANDS
Several single key commands are recognized while top is running.

h   This causes a help screen to be displayed.

?   Same as h.

i   Ignore idle processes. This is a toggle switch.

q   Quit

n   Change the number of processes to show. You will be prompted to enter the number. This over-rides automatic determination of the number of processes to show, which is based window size measurement. If n is not specified, then top will show as many processes as will fit on the screen.

#   Same as n.

k   Kill a process. You will be prompted for the PID of the task, and the signal to send to it. For a normal kill, send signal 15. For a sure, but rather abrupt kill, send signal 9. The default signal is 2, SIGINT.

r   Re-nice a process. You will be prompted for the PID of the task, and the value to nice it to. Entering a positive value will cause a process to get niced to negative values, and loose priority. If root is running top, a negative value can be entered, causing a process to get a higher than normal priority. The default renice value is 10.

s   Change the delay between updates. You will be prompted to enter the delay time, in seconds, between updates. Fractional values are recognized down to microseconds. Entering 0 causes continuous updates. The default value is 5 seconds.

^L  Erases and re-draws the screen.

UPDATING
This proc-based top works by reading the files in the proc filesystem, mounted on /proc. If /proc is not mounted, top will not work.

NOTES

Programs swapped out to disk will be shown without command line arguments.

%CPU shows the cputime/realtime percentage in the period of time between updates. For the first update, a short delay is used, and top itself dominates the CPU usage. After that, top will fall back, and a more reliable estimate of CPU usage is available

The SIZE and RSS fields don't count the page tables and the task_struct of a proc, this is at least 12k of memory that is always resident. SIZE is the virtual size of the proc (code+data+stack).

BUGS
Does not format the screen correctly if the screen width is less than about 70 characters. Also, if the screen height is less than 7 lines, formatting is incorrect.

AUTHOR
top was originally written by Roger Binns, based on Branko Lankester's (lankeste@fwi.uva.nl) ps program. Robert Nation (nation@rocket.sanders.lockheed.com re-wrote it significantly to use the proc filesystem, based on Michael K Johnson's (johnsonm@sunsite.unc.edu) proc-based ps program.