Linux Command Tools Top
The top command is a common performance analysis tool under Linux that shows the resource usage of individual processes in the system in real time, similar to the Task Manager for Windows. Top is a dynamic display process where the current state can be refreshed continuously with the user key. If the command is executed in the foreground, it will monopolize the foreground until the user terminates the program. More accurately, the top command provides real-time status monitoring of the system's processor. It will display the most "sensitive" CPU in the system. Task List. This command can be used by CPU. Memory usage and execution time to sort tasks, and many of the features of the command can be set through interactive commands or in personal customization files.
Often play under the Linux system, which is one of the commands that must be mastered;
This command is detailed below:
Enter Top entry:
top - 09:14:56 up 264 days, 20:56, 1 user, load average: 0.02, 0.04, 0.00Tasks: 87 total, 1 running, 86 sleeping, 0 stopped, 0 zombieCpu(s): 0.0%us, 0.2%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.2%stMem: 377672k total, 322332k used, 55340k free, 32592k buffersSwap: 397308k total, 67192k used, 330116k free, 71900k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1 root 20 0 2856 656 388 S 0.0 0.2 0:49.40 init 2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd 3 root 20 0 0 0 0 S 0.0 0.0 7:15.20 ksoftirqd/0 4 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
First line
09:14:56: System Current time
Day 20:56: How much time has elapsed before the system is powered on
1 Users: current 2 user online
Load average:0.02, 0.04, 0.00: System 1-minute, 5-minute, 15-minute CPU load information
Second line
tasks: task;
Total: It is well understood that there are currently 87 tasks, that is, 87 processes.
1 Running:1 a process is running
Sleeping:86 a process sleep
0 stopped: Number of processes stopped
0 Zombie: Number of zombie processes
Third line
CPU (s): Indicates that this line shows CPU overall information
0.0%us: The user-state process consumes a percentage of CPU time and does not contain the CPU time that the Renice value is a negative task consumes.
0.7%sy: Percentage of CPU time consumed by the kernel
0.0%ni: The percentage of CPU that has changed the priority of the process
99.3%id: Percentage of idle CPU time
0.0%wa: Percentage of CPU time waiting for I/O
0.0%hi:cpu% Hard Interrupt Time
0.0%si:cpu Soft Interrupt Time percentage
Note: This shows that the data is the average of all CPUs, if you want to see the processing of each CPU, press 1, fold, press 1 again;
Line Four
Men: The Meaning of memory
8175320KK Total: Amount of physical memory
8058868k used: The amount of physical memory used
116452k Free: Idle amount of physical memory
283084k buffers: The amount of physical memory used as the kernel cache
Line Five
Swap: Swap space
6881272K total: Swap area totals
4010444K used: Amount of swap area used
2870828k Free: Amount of idle swap area
4336992k cached: Total buffer swap Area
Process information
And here's the process information:
PID: ID of the process
USER: Process Owner
PR: The priority level of the process, the smaller the higher the priority is executed
Ninice: Value
VIRT: Virtual memory consumed by the process
RES: The physical memory occupied by the process
SHR: Shared memory used by the process
S: The state of the process. s for hibernation, R for running, Z for Zombie, n for the process priority value is negative
%CPU: Process Consuming CPU utilization
%MEM: The percentage of physical memory and total memory used by the process
Time+: The total CPU time that is consumed after the process is started, which is the cumulative value of the CPU usage time.
Command: Process start name
Top command Interactive operation instructions
The following is a list of some common top command action directives
q:退出top命令<Space>:立即刷新s:设置刷新时间间隔c:显示命令完全模式t::显示或隐藏进程和CPU状态信息m:显示或隐藏内存状态信息l:显示或隐藏uptime信息f:增加或减少进程显示标志S:累计模式,会把已完成或退出的子进程占用的CPU时间累计到父进程的MITE+P:按%CPU使用率排行T:按MITE+排行M:按%MEM排行u:指定显示用户进程r:修改进程renice值kkill:进程i:只显示正在运行的进程W:保存对top的设置到文件~/.toprc,下次启动将自动调用toprc文件的设置。h:帮助命令。q:退出
Note: It is emphasized that the highest frequency of use is P, T, M, because top is usually used, and we want to see which processes consume the most CPU resources and occupy the most memory;
Note: You can change the column to the right or left by using SHIFT + > or SHIFT + <
If you only need to view memory: Free command available. View only uptime information (first line), the uptime command is available;
Posted by: Big CC | 14jul,2014
Blog: blog.me115.com [Subscribe]
Weibo: Sina Weibo