ubuntu view process and end process

PID: Process identifier, the system assigns an identification code to each process, called PID.

1. View the process

1. ps auxView the details of all processes

insert image description here

2. ps a | grep 进程名Query the process information corresponding to the process name.

insert image description here

3. netstat -nlpView all processes that are connected to the network, suitable for server-side use.

insert image description here

4. pstreeThe process information is displayed in a tree form, which is convenient for viewing the child process and the parent process.

insert image description here

2. Close the process

We can close the process through the process ID pid viewed in the previous step , and execute any of the following commands to close the process:

1. kill pidClose the process.

2, kill -9 -pidforcibly close the process.

3. kill -KILL pidMore forcibly close the process.

Of course, we can also close the process through the process name command . Execute one of the following commands to close the process:

1. pkill 进程名Close the process.

2. killall 进程名Close all processes in the same process group.

Guess you like

Origin blog.csdn.net/qq_42257666/article/details/124197052