Focus on cloud service provider activities
Notes on website operation and maintenance

Common uses and cases of the kill command

When we operate and maintain the server, if we need to terminate a process, we will use the kill command, but we cannot misuse it to cause server failure. Record the common usage of the kill command in this article.

Basic usage:

 kill [signal] PID

Common usage:

 1 (SIGHUP): Terminates the process, which is often used to reload the configuration file. 9 (SIGKILL): Force the process to terminate. 15 (SIGTERM): Requests the process to terminate, allowing the process to clean up resources.

Common cases:

Terminate a process:

 kill 12345

Use SIGKILL signal to forcibly terminate the process:

 kill -9 12345

Terminate process by process name:

 pkill firefox

To use kill To terminate or terminate a process, you need to find the process ID number (PID) first. To do this, you can use different commands, such as top ps pidof and pgrep

Vote for you
Domain name host preferential information push QQ group: six hundred and twenty-seven million seven hundred and seventy-five thousand four hundred and seventy-seven Get preferential promotion from merchants.
Like( zero )
Do not reprint without permission: Lao Zuo's Notes » Common uses and cases of the kill command