This article mainly explains the basic command usage method of process management in Linux.
1. Top command
Role: Dynamic display of process status
Format: top [options]
Common options:
-D: The number of seconds to follow, that is, the entire program screen updates the number of seconds, the default is 5 seconds
-B: Perform the top in batch mode
-P: Specifies that a PID is observed
Field Meaning:
Top- 23:52:38 up 19:58, 2 users, load average:0.00, 0.00, 0.00
System average load for the last 1 minutes, 5 minutes, 15 minutes: if higher than 1 means the system is busy
tasks:135 Total, 1 running, 134 sleeping, 0 stopped, 0 zombie
Shows the type of current process of the system: running running state, sleep sleeping state, stopped stop state, zombie zombie State and its number
cpu (s): 0.0%sy, 0.0%ni, 100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
CPU overall load: Kernel space Nice value Idle Span class= "Apple-tab-span" style= "Font-family:arial, Helvetica, Sans-serif;white-space:pre;" > wait for IO to finish Hardware interrupt Software interrupts The time that was stolen
mem:1906492k Total, 414676k used, 1491816k free, 48052k buffers
Physical memory Usage: Total memory amount, used: used memory, free: idle memory, buffers: buffered memory used
swap:2097148k Total, 0k used, 2097148k free, 250760k cached
Swap memory usage, field meaning similar to physical memory
PID USER PR NI VIRT RES SHR S%cpu%MEM time+ COMMAND
Process fields: PID, Process initiator, priority, nice value, virtual memory set, resident memory set, shared memory set, process state, CPU percentage, percentage of memory consumed, process run time with CPU, command name
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/72/AD/wKiom1XrBJfB2wicAAKJS4ZRYwk338.jpg "title=" Process Management--top01.jpg "alt=" Wkiom1xrbjfb2wicaakjs4zrywk338.jpg "/>
Top supports interactive commands for specifying the display of processes:
h or?: Display Help information
L: Whether to display uptime information
T: whether to display tasks and CPU information
1: Whether the display CPU is displayed separately
Memory Information: M command
P: Sort by CPU Resource usage
M: Sort by memory-intensive resources
N: Sort by PID
T: Sort by CPU cumulative time of process consumption
K: give some PID a signal
R: Give some PID a nice re-
S: Specify the Refresh time interval
2. htop Command
Role: Dynamic display of process status
Format: htop [options]
The Htop command is the enhanced version of the top command, allowing for more intuitive and dynamic display of process information and easier management processes that require additional installation
Htop field meaning and interactive commands are the same as top, please refer to the top command.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/72/AD/wKiom1XrBzLRAmUrAATqWhP7ACc286.jpg "title=" Process Management--htop01.jpg "alt=" Wkiom1xrbzlramuraatqwhp7acc286.jpg "/>
The Htop command enables the display and management of processes through the F1~10 function key
F1: Help Options
F2: Used to adjust display properties, including display form, field order, etc.
F3: Used to specify the keyword search process
F4: Used to specify the keyword filtering process
F5: Displaying processes by tree
F6: Sort the specified fields for a process
F7 and F8: adjusting nice values
F9: Closing the specified process
F10: Exit
3. glances Command
Function: Maximizes real-time display of current system information
Format: glances [options]
Glances can display the current system CPU, memory and swap usage, process operation, network card up and down traffic, disk read/write rate, partition space usage, the function is very powerful, need to install separately.
Glances field meaning and interactive commands are the same as top, please refer to the top command.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/72/AA/wKioL1XrDsKDmE0pAAM5EDP_4iA672.jpg "title=" Process Management--glances01.jpg "alt=" Wkiol1xrdskdme0paam5edp_4ia672.jpg "/>
Glances supports interactive commands:
A: automatic way to sort processes
C: Sort the process with CPU percent occupied
M: Sort the process by the percentage of memory consumed
P: Sort processes by Process name
I: Sequencing processes at IO rate
D: Show or hide disk IO information
F: Show or hide file system Information
N: Show or hide network information
I: Show or hide logs
H: Display Help information
4. dstat Command
Function: A visualization tool that reads system resource statistics to extend the Vmstat function
Format: dstat [options]
Options:
-C: Display CPU-related information
-D: Show disk-related information
-D Total,sda,sdb,... Displays the specified disk
-G: Display page related statistics
-M: Display Memory related statistics
-N: Display network-related statistics
-P: Show process-related statistics
-R: Displays statistics related to IO requests
-S: Show swapped related statistics
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/72/AE/wKiom1XrFUKiq8-NAAGO3M-P0Ho843.jpg "title=" Process Management--dstat01.jpg "alt=" Wkiom1xrfukiq8-naago3m-p0ho843.jpg "/>
Characters commonly used paragraph meaning:
CPU: Percent occupied
USR: User occupancy
SYS: kernel occupancy
IDL: Idle Usage
Wai:io waiting to occupy
HIQ: Hardware interrupt consumption
Siq: Soft Interrupt occupancy
Disk Total: Diskette IO
READ: Reading rate
Writ: Write rate
NET total: Network traffic
Recv: Receive rate
Send: Transmit rate
Paging: Page frame rate
In: Page frame read rate
Out: Page frame readout rate
Systems: System Rate
In:interrupts, interrupt rate;
Cs:context switch, process switching rate;
Memory: RAM Usage
SWPD: Total amount of swap memory used;
Free: The total amount of idle physical memory;
Buffer: The total amount of memory used for buffer;
Cache: The total amount of memory used for the cache;
Swap: Swap partition rate
SI: Data rate for data entry into swap (KB/S)
So: Data rate from swap (KB/S)
These are the basic command methods commonly used in process management.
I have limited level, if there is improper understanding of the place, please give correct, thank you very much!
This article is from the "Pavel" blog, make sure to keep this source http://pavel86.blog.51cto.com/8349178/1691678
Linux Basics-Process management and its basic commands