This article is a mirror article of machine translation, please click here to jump to the original article.

View: 14457|Reply: 0

[linux] The difference between kill -9 and no -9 in Linux is explained in detail

[Copy link]
Posted on 10/21/2014 5:12:09 PM | | |
kill command format:
kill -Signal pid
pid is the process number, which can be found with the ps command
signal is a signal sent to a process, and TERM (or the number 9) means "unconditional termination"

Here's an example
$  whoami
root
$  ps auxw | grep vi #查询有没有运行vi程序
fenggz   13118  0.0  0.0  4140 1044 pts/1    S+   05:33   0:00 vi
root     13120  0.0  0.0  4836  640 pts/0    S+   05:33   0:00 grep vi
#答案: There is a run, process number 13118

$ kill -9 13118 #把vi杀掉 (unconditional termination)

$  ps auxw | grep vi
root     13122  0.0  0.0  4404  640 pts/0    S+   05:33   0:00 grep vi
#没有vi了...
$

kill command to kill background processes
-9 means forced kill, directly abort






Previous:memcached configuration to install and boot
Next:How to properly check the memory usage of Linux
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com