Linux Command--kill Command &killall command

Source: Internet
Author: User

The KILL command is used to terminate the run of the specified process.

Sends the specified signal to the corresponding process. Not specifying a model will send Sigterm (15) to terminate the specified process. If the program can not be terminated with the "-kill" parameter, it sends a signal of Sigkill (9), which will force the end of the process, using the PS command or the jobs command to view the process number. The root user will affect the user's process, and non-root users can only affect their own processes.

Only the 9th signal (SIGKILL) can terminate the process unconditionally, other signal processes have the right to ignore. The following are commonly used signals:

HUP 1 terminal disconnection

INT 2 Interrupt (with Ctrl + C)

Quit 3 exit (with Ctrl + \)

Term 15 termination

Kill 9 Forced termination

CONT 18 Continuation (contrary to stop, FG/BG command)

Stop 19 paused (with Ctrl + Z)

Example 1 kill process

Kill-9 Process Number

Example 2 Deleting a process for a specified user

Kill-9 $ (ps-ef | grep peidalinux) kill-u Peidalinux

Note here that the INIT process cannot be killed. Init is one of the most indispensable programs in Linux system operation. The so-called Init process, which is a user-level process initiated by the kernel. After the kernel has booted itself (already loaded into memory, started running, and has initialized all device drivers and data structures, etc.), the boot process is completed by starting a user-level program init. As a result, Init is always the first process (its process number is always 1). All other processes are descendants of the INIT process. The init process is not to be killed!


The Killall command is used to kill a process with the specified name (kill processes by name)

Example 1 kill all top commands

sudo killall top

Reference Documentation:

Http://www.cnblogs.com/peida/archive/2012/12/20/2825837.html

Http://www.cnblogs.com/peida/archive/2012/12/21/2827366.html


Linux Command--kill Command &killall command

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.