top(1) top(1)
NAME
top - display and update sorted information about processes
SYNOPSIS
top [-a -d -e -c ]
[-F -f]
[-h]
[-k]
[-L -l ]
[-o ] [-O ]
[-R -r]
[-S]
[-s ]
[-T -t]
[-U ]
[-u]
[-W -w]
[-X -x]
[-n] ]
DESCRIPTION
The top program periodically displays a list of processes on the system
in sorted order. The default key for sorting is pid, but other keys
can be used instead. Various output options are available.
OPTIONS
Command line option specifications are processed from left to right.
Options can be specified more than once. If conflicting options are
specified, later specifications override earlier ones. This makes it
viable to create a shell alias for top with preferred defaults speci-
fied, then override those preferred defaults as desired on the command
line.
-a Deprecated, equivalent to -ca.
-c
Set event counting mode to . The supported modes are:
a Accumulative mode. Count events cumulatively, starting
at the launch of top. Calculate CPU usage and CPU time
since the launch of top.
d Delta mode. Count events relative to the previous sam-
ple. Calculate CPU usage since the previous sample.
e Absolute mode. Count events using absolute counters.
n Non-event mode (default). Calculate CPU usage since the
previous sample.
-d Deprecated, equivalent to -cd.
-e Deprecated, equivalent to -ce.
-F Do not calculate statistics on shared libraries, also known as
frameworks. This substantially reduces the amount of processor
time top consumes.
-f Calculate statistics on shared libraries, also known as frame-
works (default).
-h Print command line usage information and exit.
-k Deprecated (does nothing). This flag used to turn on memory ob-
ject reporting for process 0 (kerneltask), but this is now done
by default.
-L Use interactive (non-logging) mode. If not running on a termi-
nal, exit with an error rather than running in logging mode.
-l
Use logging mode and display samples, even if standard
output is a terminal. 0 is treated as infinity. Rather than
redisplaying, output is periodically printed in raw form.
-n
Only display up to processes. can be speci-
fied as the last command line argument without the -n flag pre-
ceding it. However, doing so is deprecated command line usage.
-O
Use as a secondary key when ordering the process display.
See -o for key names (pid is default).
-o
Order the process display by sorting on in descending or-
der. A ] or - can be prefixed to the key name to specify as-
cending or descending order, respectively. The supported keys
are:
command
Command name.
cpu CPU usage.
pid Process ID (default).
prt Number of Mach ports.
reg Number of memory regions.
rprvt Resident private address space size.
rshrd Resident shared address space size.
rsize Resident memory size.
th Number of threads.
time Execution time.
uid User ID.
username
Username.
vprvt Private address space size.
vsize Total memory size.
-R Do not traverse and report the memory object map for each
process. This substantially reduces the amount of processor
time top consumes.
-r Traverse and report the memory object map for each process (de-
fault).
-S Display information about swap usage and purgeable memory.
-s
Set the delay between updates to seconds. The default
delay between updates is 1 second.
-T Do not translate uid numbers to usernames (default).
-t Translate uid numbers to usernames.
-U
Only display processes owned by . Either the username or
uid number can be specified.
-u Deprecated, equivalent to -ocpu -Otime.
-W Display ] or - to indicate deltas (default).
-w Display delta values, rather than just ] or -.
-X Run in compatibility mode.
-x Do not run in compatibility mode (default). This causes top to
display output in the same format as the version of top included
with Jaguar. Specifying this flag in combination with options
that did not exist in Jaguar's top may produce meaningless out-
put in some cases. For documentation on the usage and output of
Jaguar's top, see top(1) on a Jaguar system. When this option
is specified, all interactive key bindings are the same as in
Jaguar's top, except that the x key switches to compatibility
mode.
DISPLAY
The first several lines of the top display show various global
state. All of the information is labeled. Following is an al-
phabetical list of global state fields and their descriptions.
CPU Percentage of processor usage, broken into user, system,
and idle components. The time period for which these per-
centages are calculated depends on the event counting mode.
Disks Number and total size of disk reads and writes.
LoadAvg Load average over 1, 5, and 15 minutes. The load average
is the average number of jobs in the run queue.
emRegions Number and total size of memory regions, and total size of
memory regions broken into private (broken into non-library
and library) and shared components.
Networks Number and total size of input and output network packets.
Physem Physical memory usage, broken into wired, active, inactive,
used, and free components.
Procs Total number of processes and number of processes in each
process state.
SharedLibs Number of shared libraries, resident sizes of code and data
segments, and link editor memory usage.
Threads Number of threads.
Time Time, in Y/M/D H:M:S format. When running in accu-
mulative event counting mode, the time since top started is
printed in parentheses in H:M:S format.
Virtem Total virtual memory, virtual memory consumed by shared li-
braries, and number of pageins and pageouts.
Swap Swap usage: total size of swap areas, amount of swap space
in use and amount of swap space available.
Purgeable Number of pages purged and number of pages currently purge-
able.
Below the global state fields, a list of processes is displayed. The
fields that are displayed depend on the options that are set. Follow-
ing is an alphabetical list of fields and their descriptions.
BSYSCAL Number of BSD system calls made.
COMAND Command name.
COWFAULTS Number of faults that caused a page to be copied.
%%CPU Percentage of processor time consumed (kernel and user).
CSWITCH Number of context switches.
FAULTS Number of faults.
MSYSCAL Number of Mach system calls made.
REG Number of memory regions.
MSGSRCVD Number of Mach messages received.
MSGSENT Number of Mach messages sent.
PAGEINS Number of requests for pages from a pager.
PID Process ID.
PRT(delta) Number of Mach ports.
RPRVT(delta) Resident private memory size.
RSHRD(delta) Resident shared memory size.
RSIZE(delta) Total resident memory size, including shared pages.
TH Number of threads.
TIME Absolute processor time consumed.
UID User ID of process owner.
USERNAME Username of process owner.
VPRVT(delta) Private address space size.
VSIZE(delta) Total address space allocated, including shared pages.
INTERACTION
When top is run in interactive mode, it is possible to control the out-
put of top, as well as interactively send signals to processes. The
interactive command syntax is terse. Each command is one character,
followed by 0 to 2 arguments. Commands that take arguments prompt in-
teractively for the arguments, and where applicable, the default value
is shown in square brackets. The default value can be selected by
leaving the input field blank and pressing enter. ^^G escapes the in-
teractive argument prompt, and has the same effect as leaving the input
field blank and pressing enter.
Keypresses that do not correspond to a command cause an immediate sam-
ple update. The following commands are supported:
?? Display the help screen. Any character exits help screen mode.
This command always works, even in the middle of a command.
^^L Redraw the screen.
c
Set output mode to . The supported modes are:
a Accumulative mode.
d Delta mode.
e Event mode.
n Non-event mode.
f Toggle shared library statistics reporting.
n
Only display up to processes. 0 is treated as infini-
ty.
O
Use as a secondary key when ordering the process display.
See the o command for key names.
o
Order the process display by sorting on in descending or-
der. A ] or - can be prefixed to the key name to specify as-
cending or descending order, respectively. The supported keys
are:
command
Command name.
cpu CPU usage.
pid Process ID.
prt Number of Mach ports.
reg Number of memory regions.
rprvt Resident private address space size.
rshrd Resident shared address space size.
rsize Resident memory size.
th Number of threads.
time Execution time.
uid User ID.
username
Username.
vprvt Private address space size.
vsize Total memory size.
q Quit.
r Toggle traversal and reporting of the memory object map for each
process.
S
Send to . can be specified either as a number
or as a name (for example, HUP). The default signal starts out
as TERM. Each time a signal is successfully sent, the default
signal is updated to be that signal. is a process id.
s
Set the delay between updates to seconds.
t Toggle translation of uid numbers to usernames.
U
Only display processes owned by . Either the username or
uid number can be specified. To display all processes, press
enter without entering a username or uid number.
w Toggle wide/narrow delta mode.
x Toggle deprecated/normal mode.
EXAMPLES
top -ocpu -O]rsize -s 5 -n 20
Sort the processes according to CPU usage (descending) and resi-
dent memory size (ascending), sample and update the display at 5
second intervals, and limit the display to 20 processes.
top -ce
Run top in event counter mode.
top -tl 10
Translate uid numbers to usernames and run in logging mode, tak-
ing 10 samples at 2 second intervals.
SEE ALSO
kill(2), top(1)[Jaguar], vmstat(1), signal(3)
top top(1)
|