In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "how to use the kill command in Linux". The content is simple and clear. I hope it can help you solve your doubts. Let the editor lead you to study and learn how to use the kill command in Linux.
Kill commands and signals
When you execute a "kill" command, you actually send a signal to the system to terminate abnormal applications. There are a total of 60 signals you can use, but basically you only need to know SIGTERM (15) and SIGKILL (9).
You can use this command to see a list of all the signals:
Kill-l
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:
Kill [signal or option] PID (s)
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:
Kill SIGKILL PID
Or
Kill-9 PID
Here "- 9" represents the SIGKILL signal.
If you don't know the PID of the application, just run this command:
Ps ux
It will show all running applications and the PID of the application.
For example, to kill and drop Chrome, I would run the command:
Kill-9 3629
You can also kill multiple processes at the same time.
Kill-9 PID1 PID2 PID3
PKill
The "pkill" command allows the use of extended regular expressions and other matching methods. Instead of using PID, you can now drop them using the application's process name kill. For example, to kill the Firefox browser, simply run the command:
Pkill firefox
If you use regular expression matching, you can enter some characters of the process name, such as:
Pkill fire
To avoid kill dropping the wrong process, you should use the "pgrep-l [process name]" list to match the process name.
Killall
Killall also uses the process name instead of PID, and it kill all processes with the same name. For example, if you are running multiple instances of Firefox browsers, you can kill them all with the command:
Killall firefox
In Gnome, you can use this command to restart Nautilus:
Killall nautilus
Xkill
Xkill is an application of graphical kill. When you type "xkill" in the terminal, your cursor will immediately change to a "cross". All you have to do is click on an abnormal app and it will immediately kill the app. If you use it frequently, you can also add a keyboard shortcut to activate xkill.
The above is all the contents of the article "how to use kill commands in Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.