Top command short keys and tips

Q. How to use top command ? (Linux commands)
Top is a great command that displays the real time status of system resources like CPU, memory, processes, swap memory, etc. 

Top is one of the most using system monitoring command in unix like systems. The out put data can be sort by CPU usage, memory usage, process, etc. 


Sample output of "top" command
[root@server ~#]top

top - 19:36:00 up 10:07,  1 user,  load average: 0.00, 0.00, 0.00
Tasks: 167 total,   1 running, 166 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.3%us,  0.7%sy,  0.0%ni, 99.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   1003620k total,   727860k used,   275760k free,    68096k buffers
Swap:  3071992k total,        0k used,  3071992k free,   293536k cached
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
15021 root      20   0 15016 1216  896 R  0.7  0.1   0:00.18 top
 2079 root      20   0  113m  14m 5204 S  0.3  1.5   0:05.92 Xorg
    1 root      20   0 19316 1404 1136 S  0.0  0.1   0:00.63 init
    2 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kthreadd
    3 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 migration/0
    4 root      20   0     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0
    5 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 watchdog/0
    6 root      20   0     0    0    0 S  0.0  0.0   0:00.01 events/0
    7 root      20   0     0    0    0 S  0.0  0.0   0:00.00 cpuset
    8 root      20   0     0    0    0 S  0.0  0.0   0:00.00 khelper
    9 root      20   0     0    0    0 S  0.0  0.0   0:00.00 netns
   10 root      20   0     0    0    0 S  0.0  0.0   0:00.00 async/mgr
   11 root      20   0     0    0    0 S  0.0  0.0   0:00.00 pm
   
Monitor one or more process only
[root@server ~#]top -p 547            (Here 547 is process id )
[root@server ~#]top -p 125,554      (Monitor two process at once )


short cuts keys while running top command
q      - Quit from top
d      - change refresh interval
s      - change refresh interval
k      - Kill a process by its pid
u      - Filter by user
o      - Add or remove columns
f       - Add or remove columns
l       - Display/Hide load average
t       Display/Hide tasks
m     Display/Hide memory status

0 comments:

Related Posts Plugin for WordPress, Blogger...

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Bluehost Coupons