top command process

The top command to display the current status of the process system.

Format: top [options]

The main options are as follows.

d: specify the update interval, in seconds.

q: no delay updates. If the user has super user, the top command will be executed with the highest priority order.

c: displays the full path and name of the process.

S: CPU time accumulation mode, will be completed or disappearance of child processes add up.

s: Safe Mode.

i: do not show any idle (Idle) or useless (Zombie) process.

n: number of updates the display will exit the top after completion.

Description: The basic role of top command and ps command is the same, show the current status of the process system. But the top is a dynamic display process, i.e., the current status can be constantly refreshed by a user pressing a key. Here will be described in conjunction with the FIG information it gives.

 

The first line indicates the project were present time, the system start-up time, the current system to log the number of users, load average.

The second line shows the Tasks: Total number of 114 total process, 2 running number of running processes, number 110 sleeping the sleep of the process, 0 stopped to stop the process, 2 zombie number of zombies

The third row shows the current CPU usage, Cpu (s): 0.3% us user space occupied percentage of CPU, 1.0% sy kernel space occupied percentage of CPU, the process priority changed within 0.0% ni user process space of CPU percentage, 98.7% id CPU idle percentage, 0.0% wa waiting for input and output of the percentage of CPU time, 0.0% hi, 0.0% si

The fourth row shows the physical memory usage, Mem: the amount of physical memory 191272k total amount of memory, amount of physical memory used 173656k used, 17616k free amount of free memory, 22052k buffers as the kernel cache

The fifth line shows swap usage, Swap: 192772k total total total swap swap, swap 0k used the total amount used, the total amount of idle 192772k free exchange zone, 123988k cached buffer, the contents of memory to be swapped out to the exchange area, and then be swapped into memory, but the used swap has not been covered, the value is the size of the content already exists in the memory of the swap. Respective memory can no longer be re-written to the switching zone swapped out.

Sixth line items show up, here are explained in detail.

PID (Process ID): process mark number is non-zero positive integer. USER: User name of the process owner. PR: priority process. NI: priority value of the process. VIRT: virtual memory occupied by the process value. RES: the value of physical memory occupied by the process. SHR: shared memory used by the process. STAT: state of the process, where S represents the sleep, R represents a running, Z represents a dead state, N represents the process priority value is negative. % CPU: the process consumes CPU usage. % MEM: The percentage of physical memory and the total memory consumed by this process. TIME: total CPU time the process started after the occupation. COMMAND: command name starts the process was started, if the line does not fit on the process there will be a full command line.

top command course, you can also use some interactive commands to complete the function of other parameters. These commands are initiated via keyboard shortcuts.

<Space>: refresh immediately.

A large classified display using different resources system. It helps to quickly identify system resource consumption and more tasks.

f add and delete fields to be displayed.

o to adjust the display order of fields.

R adjust a process running Nice value.

k end of a running process.

z Color / monochrome display switch

P: sorted according to the size of the CPU used.

T: The time, total sort time.

q: quit the top command.

m: switching the display memory information.

t: switch the display process and CPU state information.

c: switch the display name and full command line command.

M: sorted according to the size of the memory used.

W: Write current settings ~ / .toprc file. It is written top profile recommended method.

Can be seen, top command is a very powerful tool for monitoring system is particularly important for system administrators. However, its disadvantage is that consumes a lot of system resources.

Guess you like

Origin www.cnblogs.com/fanweisheng/p/11108968.html