11

I just wonder why kill -9 0 ends my tty console session?

What exactly is PID 0, it is not listed on a ps aux?

0
19

killing 0 isn't killing the pid 0. Instead it is an option in kill to kill all processes in the current group. With your command you are killing everything in the process group ID (GID) of the shell that issued the kill command.

from the kill man page:

   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
  • 2
    RTFM once again - but thanks! – JohnnyFromBF Feb 27 '13 at 17:34
  • 6
    A sobering option that really teaches you to RTFM at that :) – 0xC0000022L Feb 27 '13 at 19:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.