Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Collation of kill commands commonly used in linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report