The top command

GIT – The top gives a list of the most active 20 processes in terms of CPU usage .

Display is updated every 5 seconds as a default value, you can change it by pressing d while top is running, enter the new display value in seconds, and press enter. The first line shows the time, for how long the computer has been running, number of users, CPU average load during the last 1minute, 5 minutes, 15 minutes. Again every terminal window is counted as a user, and this is the same info you get using uptime command.

The second line speaks for it self , some statistics of the processes.

The Third line is the CPU usage stats,

us “user” is the percentage of CPU time used by the user.

sy “system” the percentage of CPU time used by the kernel.

ni “Niced” is that used by the niced processes ( Niced processes are those which have a positive nice value , which means they have a different priority, see this post).

id “idle” is that used by idle processes.

wa “waiting” is that percentage of CPU time which is used by the processes waiting for I/O.

hi “hardware interrupt”, si “software interrupts” are the percentage of CPU time for which it has been servicing hardware and software interrupts.

The fourth and fifth lines speak for them selves .

Now we have 12 columns:

PID is the process ID.
USER is the name of the user running the process.
PR is the Process Priority.
NI nice value a negative nice value means higher priority, a positive nice value means lower priority.
VIRT is the total amount of virtual memory used by the task.
S Process Status
The status of the task which can be one of:
’D’ = uninterruptible sleep
’R’ = running
’S’ = sleeping
’T’ = traced or stopped
’Z’ = zombie
%CPU is the percentage of CPU time used by the process.
%MEM physical memory share.

Check out the top manual for the rest of the columns :

man top

There are a bunch of Interactive commands which can be run by pressing :

k to kill a process by giving it is PID.
r to renice a process by giving it is PID.
d to change the display time interval, just enter the new value in seconds.
q to quit top.

See the manual for more information

Print Friendly, PDF & Email



Bài viết liên quan

Be the first to comment

Để lại lời nhắn