Linux process Management is a function of the Linux kernel.
1.ps Command: Process state
SYSV style: Each option needs to add-
BSD style: Each option does not need to add-
a:显示全部与终端有关的进程 u: x:全部与终端无关的进程 -e:显示全部进程 -F:额外全然格式 -l:
2. Process classification:
Terminal-related processes
Terminal-independent processes
3. Process Status:
D: Non-disruptive sleep
R: Execute or ready
S: interruptible Sleep
T: Stop
Z: Zombies
<:高优先级进程N:低优先级进程+:前台进程组进程l:多线程进程s:会话进程
4.pstree: Show Process Tree
5.pgrep: Show process in grep style
6.pidof: Shows the PID of the program being executed
PIDOF Init
Pidof sshd
7.top:
M: Sort by resident memory size
P: Sort based on CPU percent usage
T: Sort According to cumulative time
l:是否显示平均负载和启动时间t:是否显示和CPU状态相关信息m:是否显示内存相关信息c:是否显示完整的命令行信息q:推出topk:终止某个进程-d:改变刷新延迟时长-b:以批模式显示-n #:批模式仅仅显示#批
8. Important Signals:
1:sighup: Allow a process to reread the configuration file without restarting, and let the new configuration information take effect;
2:sigint:ctrl + C, terminating
9:sigkill: Kill a process
15:sigterm: Terminates a process (default signal)
Specify a signal:
Signal Number: KILL-1
Signal Name: Kill-sigkill
Signal name shorthand: Kill-kill
9.killall command: Kills all processes named command
10. Adjust the Nice value:
To adjust the nice value of a process that has started:
Renice NI PID
Specify nice values at startup:
Nice-n NI COMMAND
11.vmstat: System Status View command
12. Front Desk –> Backstage:
Ctrl + Z
COMMAND &
BG: Let the background stop job continue execution
Jobs: View all jobs in the background
Work well, different from process number
+: Command will default action for jobs
-: command to assign a second default action to the job
FG: Returning a background job to the foreground again
FG [[%]jobid], the middle percent can be omitted, but assuming that the kill command is used, the% number must not be omitted, the default is to terminate the corresponding process, such as:
Kill 2 represents a process that kills a PID of 2. Instead of ending the job with job number 2.
Linux Process Management