Linux Kill command Usage tips

Source: Internet
Author: User

Linux Kill is a command to terminate a process. By sending a different signal to the corresponding process.
Kill command parameter:

-L signal, if no signal number parameter, then use the "-L" parameter will list all the signal names
-a The corresponding relationship between the command name and the process number is not restricted when processing the current process
-p Specifies that the KILL command prints only the process number of the associated process without sending any signals
-s specifies to send a signal
-u Specifies user

What process signals are there:

How do I find the PID of a process?

You can find the PID by Ps/pgrep/pidof/top and other commands.
Ps-ef | grep Chrome
Pgrep Chrome
PIDOF Chrome

How to kill PID?

#强制终止进程
Kill-s 9 pid

#xargs表示用前面命令输出结果作为kill-S 9 parameter
Pgrep Chrome | Xargs Kill-s 9

#命令执行结果作为参数
Kill-s 9 ' pgrep Chrome '

#pkill =pgrep+kill here without parameter S
Pkill-9 Chrome

#杀死同一进程组内所有进程, you can specify the process name
Killall httpd

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.