Linux process management

Windows has a task manager to manage processes, and Linux also has corresponding commands to manage processes.

View processes

ps command: View static process statistics

Example

top command

View process dynamic information, refresh every 3s

pgrep command

Filter query process information

pstree command

View process tree

Control process

job command

View the process tasks running in the background of the current terminal

bg command

To resume the task suspended in the background and continue to run in the background, you need to specify the task number as a parameter

kill command

Terminate the process by PID. When there are no specific options, send a termination signal to the program and exit normally.
killall command
Killing by process name is more convenient when killing multiple processes with the same name.
pkill command
Termination under specific conditions, similar to pgrep
pkill -9 -U “root”