The top command is a common performance analysis tool under Linux, similar to the Task Manager top tool under windows for dynamic real-time display system operation information. It can display the overall system information and display the task information being controlled by the kernel in the form of a list. And many of the features of the command can be set through interactive commands or in personal customization files.
1 Features:
Displays information about the processes that are currently executing on the system, including information about the process ID, memory, CPU, and so on.
2 Command format:
Top [option]
3 options:
-B Batch Processing
-C Displays the complete ruling command
-D screen Refresh interval time
-I ignores the failure process
-S Secret mode
-S cumulative mode
-i< time > Set time interval
-u< User name > Specify user name
-p< Process number > Specify process
-n< number of times > cycle display
4 Interactive command options:
H: Display Help information
K: Terminate a process
I: Ignore idle and zombie processes, which is a switching process
Q: Exit the program
R: Reschedule the priority level of a process
S: Switch to cumulative mode
S: Change the delay time between two refreshes (unit s), and if there are decimals, convert to Ms. Input 0 The system is constantly refreshed, the default value is 5s
F or F: Onions Add or remove items from the current display
O or O: Change the order in which items are displayed
L: Toggle display of average load and start time information
M: Toggle Whether memory information is displayed
T: Toggles whether to display process and CPU status information
C: Toggle display command name and full command line
M: Sort based on the size of the resident memory
P: Sort based on CPU usage percent size
T: Sort by Time/cumulative time
W: Writes the current settings to the ~/.TOPRC file
example
#toptop - 16:52:51 up 5:37, 2 users, load Average: 0.31, 0.42, 0.33tasks: 85 total, 1 running, &NBSP;&NBSP;84&NBSP;SLEEPING,&NBSP;&NBSP;&NBSP;0&NBSP;STOPPED,&NBSP;&NBSP;&NBSP;0&NBSP;ZOMBIECPU (s): 0.3%us, 0.3%sy, 0.0%ni, 99.0%id, 0.0%wa, 0.0%hi, 0.3%si, 0.0%stmem: 1004136k total, 456464k used, 547672k free, 26492k buffersSwap: 1048572k total, 0k used, 1048572k free, 214520k cached PID USER PR NI Virt res shr s %cpu %mem time+ command 4 root 20 0 0 0 0 s 0.3 0.0 0:51.06 ksoftirqd/0 1570 root 20 0 2221m 88m 13m S 0.3 9.1 5:04.60 java 1 root 20 0 19360 1524 1228 s 0.0 0.2 0:07.40 init 2 root 20 0 0 0 0 s 0.0 0.0 0:00.03 kthreadd 3 root RT 0 0 0 0 s 0.0 0.0 0:00.00 migration/0 5 root RT 0 0 0 0 S 0.0 0.0 0:00.00 stopper/0 6 root rt 0 0 0 0 s 0.0 0.0 0:00.84 watchdog/0 7 root 20 0 0 0 0 S 0.0 0.0 1:03.96 events/0
Description
Statistical information Area:
The first five elements are the statistical information area of the current system situation as a whole.
16:52:51: Current system time
Up 5:37: System uptime
2 Users: Current two user login system
Load average:0.31, 0.42, 0.33: System load, Task queue average length.
The three numbers behind the load average are 1-minute, 5-minute, and 15-minute load averages respectively.
When the CPU is completely idle, the average load is 0, and when the CPU workload is saturated, the average load is 1.
tasks:85 Total, 1 running, sleeping, 0 stopped, 0 Zombie: Process information
The system currently has a total of 85 processes, of which there are 1 running, 84 in sleep sleep 0 stoped 0 Zombie Zombie Process
Cpu (s): 0.3%us, 0.3%sy, 0.0%ni, 99.0%id, 0.0%wa, 0.0%hi, 0.3%si, 0.0%st:cpu info
0.3%us percentage of CPU used by user space
0.3%sy percentage of CPU used in kernel space
0.0%ni percentage of CPU used by the priority process changed
99.0%id Percentage of idle CPUs
0.0%wa IO waiting to occupy CPU
0.0%hi Hard Interrupt (Hardware IRQ)% of CPU occupied
0.3%si Soft interrupt (software interrupts)% of CPU occupied
0.0%st Virtual CPU Idle CPU percentage
mem:1004136k Total, 456464k used, 547672k free, 26492k buffers memory information
Total physical memory of 1004136k
456464k used amount of memory occupied
547672k Free amount of idle memory
The amount of memory in 26492k buffers cache
swap:1048572k Total, 0k used, 1048572k free, 214520k Cached Exchange partition information
Total Swap Area 1048572k
The amount of swap partitions used by the 0k used
1048572k Free Swap partition amount
214520k cached buffer Swap area total
PID Process Number
USER Process Owner
PR Process Priority
NI Nice value negative indicates high priority, positive values are low priority
VIRT The total amount of virtual memory used by the process Virt=res+swap
The size of the physical memory used by the RES process that has not been swapped out Res=code+data
SHR Shared Memory Size
S process state. d= non-disruptive sleep status r= run s= sleep t= track/stop z= zombie Process
%cpu percentage of CPU time that was last updated to current
Percentage of physical memory used by the%MEM process
Total CPU time used by the time+ process, Unit 1/100 sec
Command process name (commands name/command line)
1 in the top run state, enter 1 instructions to display the CPU per logical unit
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/84/2C/wKioL1eHZarC4w4tAAAuezEG0Ss548.png "style=" float: none; "title=" 1.png "alt=" Wkiol1ehzarc4w4taaauezeg0ss548.png "/>
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/84/2D/wKiom1eHZaug2A-2AAA5MK2M2GQ515.png "style=" float: none; "title=" 2.png "alt=" Wkiom1ehzaug2a-2aaa5mk2m2gq515.png "/>
2 process word Degaliang and sorting
Highlight Switch B sort switch x You can change the sort order to the right or left by using "Shift +>" or "Shift + <"
Press the B key to open the highlight
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/84/2C/wKioL1eHZh6yVvOWAAAvZnv9Kuw101.png "style=" float: none; "title=" 3.png "alt=" Wkiol1ehzh6yvvowaaavznv9kuw101.png "/>
Press the X key to sort by default is the CPU column
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/84/2D/wKiom1eHZh6SUXcGAAAtYmj_iHE580.png "style=" float: none; "title=" 4.png "alt=" Wkiom1ehzh6suxcgaaatymj_ihe580.png "/>
use SHIFT + > or SHIFT + < To change the column to the right or left
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/84/2D/wKiom1eHZh7gGpgrAAA9k-u0YUE031.png "style=" float: none; "title=" 5.png "alt=" Wkiom1ehzh7ggpgraaa9k-u0yue031.png "/>
3 displaying the complete command command:top–c
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/84/2C/wKioL1eHZh_C5fDPAAAvV8uv958188.png "style=" float: none; "title=" 6.png "alt=" Wkiol1ehzh_c5fdpaaavv8uv958188.png "/>
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/84/2C/wKioL1eHZh-zRsBKAAA5Eh2eX_Q807.png "style=" float: none; "title=" 7.png "alt=" Wkiol1ehzh-zrsbkaaa5eh2ex_q807.png "/>
4 Setting Information update times:
Top–n 3: Information stops updating after 3 updates, exit top
5 Set Information refresh interval: Default refresh time is 5s
Top–d 2: Refresh the screen information every two seconds
If there is any mistake, please correct me!
Thank you!
This article is from "Rookie Roger" blog, please be sure to keep this source http://rogerwang.blog.51cto.com/5326353/1826480
The Linux top command is detailed