Get the App
SLTechnology News&Howtos  ›  Servers  › 

Collation of kill commands commonly used in linux

Shulou Source: shulou.com Published: 2022-06-01 10:54:40 10月22日 Update

This article mainly introduces "the arrangement of kill commands commonly used in linux". In daily operation, I believe many people have doubts about the arrangement of kill commands commonly used in linux. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "kill commands commonly used in linux". Next, please follow the editor to study!

When we execute a "kill" command, we are actually sending a signal to the system to terminate abnormal applications. At present, the kill command has a total of 60 signals that you can use, but basically we only need to know SIGTERM (15) and SIGKILL (9). These two are the most commonly used, and the other commonly used commands are listed below:

1 HUP: hangup

2 INIT: equivalent to Ctrl + c

9 KILL

15 TERM: Terminate (default signal for kill)

18 CONT: Continue (recover from STOP signal)

19 STOP: Stop

We can use the kill-l command to list the entire kill signal.

SIGTERM-this signal requests a process to stop running. This signal can be ignored. A process can take a period of time to shut down normally, and a normal shutdown of a program usually takes a period of time to save progress and release resources. In other words, it is not a forced stop.

SIGKILL-this signal forces the process to stop running immediately. The program cannot ignore this signal, and unsaved progress will be lost.

The syntax for using kill is:

The default signal (when not specified) is SIGTERM. When it doesn't work, you can use the following command to force kill to drop a process:

The most commonly used command is kill-9, which is used as follows:

Here-9 represents the SIGKILL signal. That is, the number before each command and signal in the previous signal list.

If you don't know the PID of the application, just run this command:

What we often use is ps ux | grep java. The kill command also has several sibling commands, such as PKill, Killall, xkill, etc.

At this point, the study of "sorting out kill commands commonly used in linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Commands signals commonly used processes learning compulsion running time more programs progress help applications utility and then two that is representatives functions brothers. Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno MySQL Linux Microsoft Shulou Technology