PID: Process identifier, the system assigns an identification code to each process, called PID.
1. View the process |
---|
1. ps aux
View the details of all processes
2. ps a | grep 进程名
Query the process information corresponding to the process name.
3. netstat -nlp
View all processes that are connected to the network, suitable for server-side use.
4. pstree
The process information is displayed in a tree form, which is convenient for viewing the child process and the parent process.
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 pid
Close the process.
2, kill -9 -pid
forcibly close the process.
3. kill -KILL pid
More 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.