Linux commands (005)-Comparison of Kill, Pkill, and Killall

Source: Internet
Author: User

The KILL command is used to "kill" the process that specifies the process PID. Terminate a foreground process you can use CTRL + C and terminate a background process with the KILL command. The KILL command ends the process by sending a specified signal to the process. By default, the KILL command sends a term signal to the process (all), and the term signal terminates all processes that cannot capture the signal. If you want to terminate the process that can capture the signal, send a Kill signal (9) and forcibly "kill" the process. Use kill-9 to be careful, in the database (Oracle, MySQL, etc.) server, try not to use kill-9 kill database related processes, this may bring you disastrous results.

The Killall command is used to "kill" a process that specifies a name. The biggest difference with the kill command is that using the KILL command must know the PID number of the "kill" process, then we have to use commands such as ps/pidof/pstree/top to get the PID of the process. Pkill and Killall Apply the same method, but also directly kill the running process.

The use of the above command is relatively simple, this article will not repeat.

Linux commands (005)-Comparison of Kill, Pkill, and Killall

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.