<>Top command

Linux The system can top Command to view the of the system CPU, Memory , Running time , Swap partition , Execution thread and other information . adopt top Command can effectively find out the defects of the system , Is there not enough memory ,CPU Insufficient processing capacity ,IO Reading and writing too high , Therefore, it is often necessary to understand the running state of the server ,top Command is a very useful tool to help us understand the current state of the server .

stay linux In terminal , input top, Press Enter, Enter immediately top Interface

If you operate correctly , You should see the following interface .

This is the scene , What's the matter? Are you confused

Don't panic , Sit down and listen to me patiently. You'll understand what this pile of content is for

Here's what each item does

Each item is explained in detail below

First line : Overview of the overall situation of the system
top - 13:07:08 up 1 day, 22:31, 1 user, load average: 0.09, 0.05, 0.06
Displayed content text cross reference

top name
19:25:37 Current system time (19 Time 25 branch 37 second )
1 day,22:31 Time the system has been running so far (1 day 22 hour 31 minute )
1 user Number of users currently logged in to the system (1)
load average: 0.09, 0.05, 0.06 System load :1 minute /5 minute /15 Minute level ( For single core CPU 1.0 Indicates full load )
Comparison of displayed contents with pictures

The first 2 that 's ok : Process status
Tasks: 88 total, 1 running, 87 sleeping, 0 stopped, 0 zombie
Displayed content text cross reference

Tasks: 88 total Number of all started processes :88 individual
1 running Number of running processes :1 individual
87 sleeping87 Current sleep state
0 stopped Number of processes stopped :0 individual
0 zombie Number of zombie processes :0 individual
Comparison of displayed contents with pictures

The first 3 that 's ok :CPU state
%Cpu(s): 0.3 us, 0.3 sy, 0.0 ni, 99.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
Displayed content text cross reference

%Cpu(s)CPU Occupancy ratio
0.3 us User space occupation CPU percentage
0.3 sy Kernel space occupation CPU percentage
0.0 ni Occupied by processes with changed priority in user space CPU percentage
99.3 id free CPU percentage
0.0 wa Wait for input and output CPU Time percentage
0.0 hiCPU Total time spent servicing hardware outages
0.0 siCPU Total time spent on service soft outages
0.0 stSteal Time
Comparison of displayed contents with pictures

The first 4 that 's ok : Physical memory status
KiB Mem : 1006540 total, 332296 free, 68028 used, 606216 buff/cache
Displayed content text cross reference

KiB Mem Company kib physical memory
1006540 total total
332296 free free
68028 used68028 used
606216 buff/cache Kernel cache usage
Comparison of displayed contents with pictures

The first 5 that 's ok : Swap Exchange area status
KiB Swap: 0 total, 0 free, 0 used. 722660 avail Mem
Displayed content text cross reference

KiB Swap Company kib Exchange area
0 total total
0 free free
0 used Used
722660 avail Mem722660 avail Mem
Comparison of displayed contents with pictures

Last line : Specific process information
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
Displayed content text cross reference

PID process ID
USER Process owner
PR priority
NInice value , Negative values indicate high priority , A positive value indicates low priority
VIRT The total amount of virtual memory used by the process
RES Used by the process , Physical memory size not swapped out
SHR Shared memory size
S Process status
%CPU Last updated to now CPU Time occupancy percentage
%MEM Percentage of physical memory used by the process
TIME+ Process use CPU Total time
COMMAND Command name , command line
<>top Common shortcut keys under command

* shift+e Switch memory display mode ( Repeatable key switching )
* z Toggle color display ( Repeatable key switching )
* m Switch memory display mode ( Repeatable key switching )
* e Toggles the display mode of units in the bottom process ( Repeatable key switching )
* b Toggle highlight selected ( Repeatable key switching )
* W Save the current configuration to a file , Next start top The current configuration will be used
* h Enter the help menu ( After entering the menu , Can press ESC or q Exit the help menu )
* q sign out top command
shift+e Switch memory display mode :

Press the key repeatedly to switch units
Tips : Watch for unit changes

Press and hold z key Toggle color display :

Press and hold m Key to switch memory display mode :

Press the key repeatedly to switch the memory display mode

Displays the memory status as a vertical bar

Display memory status as a bar graph

Press and hold e, Toggles the display mode of units in the bottom process :

Press and hold b Key toggle highlight :

<> sort field

Process sorting at the bottom , Yes, you can choose to sort by the specified column .

* Press first f Enter the field selection interface ,
* Then press the up and down keys to select the fields to sort , The interface is highlighted , Select the appropriate content
* After confirming the selected operation , Press s key , Activate this selection .
* Last press q Press to exit the sorting field selection interface .
You can see that the default sort is very messy

Press and hold f Key to enter the field selection interface :

Press the up and down keys to select the fields to sort :

Press and hold s Key to activate this selection

Press and hold q Exit the sorting field selection interface :

You can see that the sorting is based on RES Fields are arranged from large to small

Here we are top The common basic commands have been finished , I believe you have learned a lot of knowledge .

<> This article only talks about a few common commands , If you want to know more, you can study deeply by yourself ~

Technology
©2019-2020 Toolsou All rights reserved,
What is a process , Concept of process ? Tang Seng team to lay off staff , Who will you lay off ?Oracle Database access performance optimization JVM Old age garbage collection Full GCweb Two front-end practical games ( Attached source code ) about linux command “iptables -F”, Don't carry it out easily navicat function sql File error 2021-06-03 A man is not born to be defeated Pandas And openpyxl Super combination of Library , bye ,Excel! It is never recommended to spend a lot of time studying for employment python