In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
In this issue, the editor will bring you about the method of killing the Linux system. The article is rich in content and analyzed and described from a professional point of view. I hope you can get something after reading this article.
Search process
The first step in killing the unresponsive process is to find it. There are two commands to locate a process: top and ps. At the top are the tools that every administrator should know. With the top, you will get a complete list of processes that are currently running. From the command line, send back to the top to view a list of running processes
You will see some very important information from this list. Chrome, for example, has become unresponsive. From our top-level display, we can see that there are four running chrome instances using process ID (PID) 3827, 3919, 10764 and 11679. Using a specific way to kill the process, this information will be important.
Although the top is very convenient, it is not always the most effective way to get the information you need. Suppose you know that the Chrome process is the one you need to kill, and you don't want to see the real-time information provided at the top. To do this, you can use the ps command and filter the output through grep. The PS command reports the current process, and a snapshot of the grep pattern matches the print line. The reason we filter ps through grep is simple: if you issue the ps command yourself, you will get a list of snapshots of all current processes. We just want the list associated with Chrome.
Ps aux | grep chrome. The auxiliary options are as follows:
A = displays the process for all users
U = display the user / owner of the process
X = also shows processes that are not attached to the terminal
The x option is important when you search for information about graphics applications.
When you issue the above command, you will get more information than you need (figure 2) to prevent the death of a process, but sometimes it is more effective than using top.
Kill process
Now we come to the task of killing this process. We have two pieces of information that will help us kill the wrong process:
1. Process name
2. Process ID
The command you use will determine which one is used for termination. There are two commands to kill the process:
1. Kill-Kill a process through ID
2. Killall-Kills a process by name
You can also send different signals to two kill commands. The signal you send will be determined by the result required in the kill command. For example, you can send a HUP signal to the kill command, which effectively restarts the process. This is always a wise choice when you need to restart the process immediately (for example, in the case of a daemon). You can get a list of all the signals that can be sent to the kill command by issuing kill-l. You'll find a lot of signals
The most common kill signal is:
Signal name single value affects SIGHUP1 hang up SIGINT2 from keyboard interrupt SIGKILL9 kill signal SIGTERM15 termination signal SIGSTOP17,19,23 stop process which is good, you can use signal value instead of signal name. So you don't have to remember all the names of all kinds of signals. So now we use the kill command to kill our chrome instance. The structure of this command will be:
Kill SIGNAL PID where SIGNAL is the signal to be sent and PID is the process ID to be killed. We already know that the ID we are ordered to kill from our ps are 3827, 3919, 10764 and 11679. So to send a kill signal, we issue a command: once we issue the above command, all chrome processes will be killed successfully. Let's take the simple route! If we already know that the process we want to kill is named chrome, we can use the killall command and send the same signal, as follows:
The only consideration with the above command kill-9 3827 kill-9 3919 kill-9 10764 kill-9 11679 is that it may not be able to capture all running chrome processes. If, after running the above command, you issue the ps aux | grep chrome command and see the remaining processes running, the best way is to return the kill command and send a signal 9 to terminate the process through PID.
It's easier to end the process.
As you can see, the process of killing mistakes is not as challenging as you previously thought. When I end a stubborn process, I tend to start with the killall command, because it is the most effective termination route. However, when you end a very attractive process, killing orders is the way to go. Learn more about Linux through Linux fundamentals and edX's free "introduction to Linux" course.
The above is the editor for you to share the Linux system to kill the process of what is, if you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are 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.