Tell me more ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question

1 Answer

up vote 13 down vote accepted

killing 0 isnt 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.
share|improve this answer
1  
RTFM once again - but thanks! – Ian Feb 27 at 17:34
4  
A sobering option that really teaches you to RTFM at that :) – 0xC0000022L Feb 27 at 19:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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