top also displays other info besides the running processes, like free memory both physical and swap
Usage
top [options]
Options
- -d ss.tt
- Delay -- Specifies the seconds and tenths of seconds of delay between the updates of the info showed on the screen, being the default 3 seconds
- -i
- Starts top with the last remembered 'i' state reversed. When this toggle is Off, tasks that are idled or zombied will not be displayed.
- -n n
- Specifies the maximum number of iterations, or frames, top should produce before ending.
- -p n
- Monitor only processes with specified process IDs. This option can be given up to 20 times, or you can provide a comma delimited list with up to 20 pids. Co-mingling both approaches is permitted. This is a command-line option only. And should you wish to return to normal operation, it is not necessary to quit and and restart top -- just issue the '=' interactive command.
- -s
- - Secure - Runs top in secure mode, restricting the commands you can use while top is running even for root
- -S (Sum)
- Starts top with the last remembered 'S' state reversed. When 'Cumulative mode' is On, each process is listed with the cpu time that it and its dead children have used. See the 'S' interactive command for additional information regarding this mode.
- a: PID -- Process Id
- The task's unique process ID, which periodically wraps, though never restarting at zero.
- b: PPID -- Parent Process Pid
- The process ID of a task's parent.
- c: RUSER -- Real User Name
- The real user name of the task's owner.
VIRT = SWAP + RES.
'D' = uninterruptible sleep
'R' = running
'S' = sleeping
'T' = traced or stopped
'Z' = zombie Tasks shown as running should be more properly thought of as 'ready to run' -- their task_struct is simply represented on the Linux run-queue. Even without a true SMP machine, you may see numerous tasks in this state depending on top's delay interval and nice value.
( mdrecoveryd )
Either form of display is subject to potential truncation if it's too long to fit in this field's current width. That width depends upon other fields selected, their order and the current screen width.
Note: The 'Command' field/column is unique, in that it is not fixed-width. When displayed, this column will be allocated all remaining screen width (up to the maximum 512 characters) to provide for the potential growth of program names into command lines.
increased by over 700Kb. Your only means of reducing that overhead
will be to stop and restart top.
While top is running you may issue some options that will interact immediately with top these options are:
- h
- Help, displays a summary of command that will modify the behavior of top
- k
- Kills a process, you will be able to kill only your own processes, unless you are running top as root
- n
- Once this command is entered top will ask you how many lines you want on your screen, if you enter 0 top will display as much as it can
- q
- Exits top
- r
- Change the priority of a process, as well as with k you will only be able to act on your own processes unless you are root
- W
- Writes the current configuration to your personal configuration file, which is $HOME/.toprc
top - 22:29:04 up 7:16, 3 users, load average: 0.06, 0.08, 0.08
Tasks: 105 total, 2 running, 99 sleeping, 0 stopped, 4 zombie
Cpu(s): 2.5%us, 0.7%sy, 0.0%ni, 95.7%id, 1.0%wa, 0.2%hi, 0.0%si, 0.0%st
Mem: 1035196k total, 796652k used, 238544k free, 55680k buffers
Swap: 2650684k total, 0k used, 2650684k free, 432516k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
4267 root 15 0 320m 45m 10m S 4 4.5 4:45.33 X
2865 haldaemo 17 0 5736 4136 1864 S 0 0.4 0:23.18 hald
1 root 15 0 744 288 240 S 0 0.0 0:01.15 init
2 root RT 0 0 0 0 S 0 0.0 0:00.00 migration/0
3 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/0
4 root RT 0 0 0 0 S 0 0.0 0:00.00 migration/1
5 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/1
6 root 10 -5 0 0 0 S 0 0.0 0:00.12 events/0
7 root 10 -5 0 0 0 S 0 0.0 0:00.00 events/1
8 root 12 -5 0 0 0 S 0 0.0 0:00.00 khelper
9 root 10 -5 0 0 0 S 0 0.0 0:00.00 kthread
13 root 14 -5 0 0 0 S 0 0.0 0:00.00 kblockd/0
14 root 10 -5 0 0 0 S 0 0.0 0:00.00 kblockd/1
15 root 16 -5 0 0 0 S 0 0.0 0:00.00 kacpid
125 root 11 -5 0 0 0 S 0 0.0 0:00.00 cqueue/0
126 root 11 -5 0 0 0 S 0 0.0 0:00.00 cqueue/1
127 root 10 -5 0 0 0 S 0 0.0 0:00.02 kseriod
171 root 16 0 0 0 0 S 0 0.0 0:00.00 pdflush
172 root 15 0 0 0 0 S 0 0.0 0:00.06 pdflush
173 root 12 -5 0 0 0 S 0 0.0 0:00.00 kswapd0
174 root 12 -5 0 0 0 S 0 0.0 0:00.00 aio/0
175 root 13 -5 0 0 0 S 0 0.0 0:00.00 aio/1
435 root 12 -5 0 0 0 S 0 0.0 0:00.00 kpsmoused
847 root 10 -5 0 0 0 S 0 0.0 0:00.00 ata/0