为什么“ kill -9 0”结束控制台会话?


11

我只是想知道为什么kill -9 0结束我的tty控制台会话?

PID 0到底是什么,它未在ps aux?上列出?

Answers:


19

killing 0不会杀死pid0。相反,它是kill杀死当前组中所有进程的一种选择。使用您的命令,您将杀死发出该kill命令的外壳程序的进程组ID(GID)中的所有内容。

kill手册页:

   pid... Specify the list of processes that kill should signal.  Each pid
      can be one of five things:

          ...

      0      All processes in the current process group are signaled.

2
RTFM再一次-但是,谢谢!
JohnnyFromBF

6
确实可以教您RTFM的醒目的选项:)
0xC0000022L13年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.