I just wonder why
kill -9 0 ends my tty console session?
What exactly is PID 0, it is not listed on a
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
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 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.