为什么在 unix 的 kill -9 命令中使用数字 9? [英] Why number 9 in kill -9 command in unix?

查看:17
本文介绍了为什么在 unix 的 kill -9 命令中使用数字 9?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这是题外话,我在网上找不到任何地方,我想也许社区中的编程大师可能知道这一点.
我通常使用

I understand it's off topic, I couldn't find anywhere online and I was thinking maybe programming gurus in the community might know this.
I usually use

kill -9 pid

杀死工作.我一直想知道 9 的由来.我在网上查了一下,上面写着

to kill the job. I always wondered the origin of 9. I looked it up online, and it says

9 表示不可捕获或不可忽略的 KILL 信号.换句话说,它会指示进程(某些正在运行的应用程序)立即退出"(来源:http://wiki.answers.com/Q/What_does_kill_-9_do_in_unix_in_its_entirety)

"9 Means KILL signal that is not catchable or ignorable. In other words it would signal process (some running application) to quit immediately" (source: http://wiki.answers.com/Q/What_does_kill_-9_do_in_unix_in_its_entirety)

但是,为什么是 9?那么其他数字呢?有什么历史意义还是因为Unix的架构?

But, why 9? and what about the other numbers? is there any historical significance or because of the architecture of Unix?

推荐答案

参见 维基百科关于 Unix 信号的文章对于其他信号的列表.SIGKILL 恰好得到了 9.

See the wikipedia article on Unix signals for the list of other signals. SIGKILL just happened to get the number 9.

你也可以使用助记符,就像数字一样:

You can as well use the mnemonics, as the numbers:

kill -SIGKILL pid

这篇关于为什么在 unix 的 kill -9 命令中使用数字 9?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆