The Linux Top Command
The linux top command will show you the running process on the server or desktop (linux based system) this is like the task manager in windows. To run the command just type in the commandline: top
Several useful keys when on the program click a letter on the key board for example
u - this will ask you to put a user in the field and it will only show the process for that user
For more commnads press h the below help will show:
Help for Interactive Commands - procps version 3.2.7
Window 1:Def: Cumulative mode Off. System: Delay 3.0 secs; Secure mode Off.
Z,B Global: 'Z' change color mappings; 'B' disable/enable bold
l,t,m Toggle Summaries: 'l' load avg; 't' task/cpu stats; 'm' mem info
1,I Toggle SMP view: '1' single/separate states; 'I' Irix/Solaris mode
f,o . Fields/Columns: 'f' add or remove; 'o' change display order
F or O . Select sort field
<,> . Move sort field: '<' next col left; '>' next col right
R,H . Toggle: 'R' normal/reverse sort; 'H' show threads
c,i,S . Toggle: 'c' cmd name/line; 'i' idle tasks; 'S' cumulative time
x,y . Toggle highlights: 'x' sort field; 'y' running tasks
z,b . Toggle: 'z' color/mono; 'b' bold/reverse (only if 'x' or 'y')
u . Show specific user only
n or # . Set maximum tasks displayed
k,r Manipulate tasks: 'k' kill; 'r' renice
d or s Set update interval
W Write configuration file
q Quit
( commands shown with '.' require a visible task display window )
Press 'h' or '?' for help with Windows,
any other key to continue
Below is an actual top output
top - 09:13:20 up 29 days, 19:47, 2 users, load average: 0.05, 0.09, 0.10
Tasks: 272 total, 1 running, 271 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 0.2%sy, 0.0%ni, 99.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 2066204k total, 1924936k used, 141268k free, 270768k buffers
Swap: 4192944k total, 16k used, 4192928k free, 923028k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
25063 root 15 0 2428 1140 792 R 0.7 0.1 2:02.36 top
1 root 15 0 2160 628 548 S 0.0 0.0 0:00.68 init
2 root RT -5 0 0 0 S 0.0 0.0 0:00.01 migration/0
3 root 34 19 0 0 0 S 0.0 0.0 0:00.09 ksoftirqd/0
4 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
5 root RT -5 0 0 0 S 0.0 0.0 0:00.00 migration/1
6 root 38 19 0 0 0 S 0.0 0.0 0:00.22 ksoftirqd/1
7 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/1
8 root 10 -5 0 0 0 S 0.0 0.0 0:00.43 events/0
9 root 10 -5 0 0 0 S 0.0 0.0 0:00.41 events/1
10 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khelper
11 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kthread
15 root 10 -5 0 0 0 S 0.0 0.0 0:11.63 kblockd/0
16 root 10 -5 0 0 0 S 0.0 0.0 0:01.37 kblockd/1
17 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 kacpid
122 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 cqueue/0
123 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 cqueue/1
126 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khubd
128 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kseriod
194 root 19 0 0 0 0 S 0.0 0.0 0:00.00 khungtaskd
195 root 15 0 0 0 0 S 0.0 0.0 3:05.87 pdflush
196 root 15 0 0 0 0 S 0.0 0.0 3:16.72 pdflush
197 root 10 -5 0 0 0 S 0.0 0.0 6:44.90 kswapd0
198 root 16 -5 0 0 0 S 0.0 0.0 0:00.00 aio/0
199 root 17 -5 0 0 0 S 0.0 0.0 0:00.00 aio/1
362 root 11 -5 0 0 0 S 0.0 0.0 0:00.00 kpsmoused
395 root 16 -5 0 0 0 S 0.0 0.0 0:00.00 ata/0
396 root 16 -5 0 0 0 S 0.0 0.0 0:00.00 ata/1
397 root 17 -5 0 0 0 S 0.0 0.0 0:00.00 ata_aux
401 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_0
402 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_1
403 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_2
404 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_3
414 root 14 -5 0 0 0 S 0.0 0.0 0:00.00 kstriped
429 root 11 -5 0 0 0 S 0.0 0.0 6:40.89 md1_raid1
432 root 10 -5 0 0 0 S 0.0 0.0 0:00.89 md0_raid1
433 root 10 -5 0 0 0 S 0.0 0.0 12:30.57 kjournald
Several useful keys when on the program click a letter on the key board for example
u - this will ask you to put a user in the field and it will only show the process for that user
For more commnads press h the below help will show:
Help for Interactive Commands - procps version 3.2.7
Window 1:Def: Cumulative mode Off. System: Delay 3.0 secs; Secure mode Off.
Z,B Global: 'Z' change color mappings; 'B' disable/enable bold
l,t,m Toggle Summaries: 'l' load avg; 't' task/cpu stats; 'm' mem info
1,I Toggle SMP view: '1' single/separate states; 'I' Irix/Solaris mode
f,o . Fields/Columns: 'f' add or remove; 'o' change display order
F or O . Select sort field
<,> . Move sort field: '<' next col left; '>' next col right
R,H . Toggle: 'R' normal/reverse sort; 'H' show threads
c,i,S . Toggle: 'c' cmd name/line; 'i' idle tasks; 'S' cumulative time
x,y . Toggle highlights: 'x' sort field; 'y' running tasks
z,b . Toggle: 'z' color/mono; 'b' bold/reverse (only if 'x' or 'y')
u . Show specific user only
n or # . Set maximum tasks displayed
k,r Manipulate tasks: 'k' kill; 'r' renice
d or s Set update interval
W Write configuration file
q Quit
( commands shown with '.' require a visible task display window )
Press 'h' or '?' for help with Windows,
any other key to continue
Below is an actual top output
top - 09:13:20 up 29 days, 19:47, 2 users, load average: 0.05, 0.09, 0.10
Tasks: 272 total, 1 running, 271 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 0.2%sy, 0.0%ni, 99.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 2066204k total, 1924936k used, 141268k free, 270768k buffers
Swap: 4192944k total, 16k used, 4192928k free, 923028k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
25063 root 15 0 2428 1140 792 R 0.7 0.1 2:02.36 top
1 root 15 0 2160 628 548 S 0.0 0.0 0:00.68 init
2 root RT -5 0 0 0 S 0.0 0.0 0:00.01 migration/0
3 root 34 19 0 0 0 S 0.0 0.0 0:00.09 ksoftirqd/0
4 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
5 root RT -5 0 0 0 S 0.0 0.0 0:00.00 migration/1
6 root 38 19 0 0 0 S 0.0 0.0 0:00.22 ksoftirqd/1
7 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/1
8 root 10 -5 0 0 0 S 0.0 0.0 0:00.43 events/0
9 root 10 -5 0 0 0 S 0.0 0.0 0:00.41 events/1
10 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khelper
11 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kthread
15 root 10 -5 0 0 0 S 0.0 0.0 0:11.63 kblockd/0
16 root 10 -5 0 0 0 S 0.0 0.0 0:01.37 kblockd/1
17 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 kacpid
122 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 cqueue/0
123 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 cqueue/1
126 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khubd
128 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kseriod
194 root 19 0 0 0 0 S 0.0 0.0 0:00.00 khungtaskd
195 root 15 0 0 0 0 S 0.0 0.0 3:05.87 pdflush
196 root 15 0 0 0 0 S 0.0 0.0 3:16.72 pdflush
197 root 10 -5 0 0 0 S 0.0 0.0 6:44.90 kswapd0
198 root 16 -5 0 0 0 S 0.0 0.0 0:00.00 aio/0
199 root 17 -5 0 0 0 S 0.0 0.0 0:00.00 aio/1
362 root 11 -5 0 0 0 S 0.0 0.0 0:00.00 kpsmoused
395 root 16 -5 0 0 0 S 0.0 0.0 0:00.00 ata/0
396 root 16 -5 0 0 0 S 0.0 0.0 0:00.00 ata/1
397 root 17 -5 0 0 0 S 0.0 0.0 0:00.00 ata_aux
401 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_0
402 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_1
403 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_2
404 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_3
414 root 14 -5 0 0 0 S 0.0 0.0 0:00.00 kstriped
429 root 11 -5 0 0 0 S 0.0 0.0 6:40.89 md1_raid1
432 root 10 -5 0 0 0 S 0.0 0.0 0:00.89 md0_raid1
433 root 10 -5 0 0 0 S 0.0 0.0 12:30.57 kjournald
Comments