13

I saw the command killall -9 but there is not such a option in the man page.

So now I'm a bit confused: what does -9 option mean?

Qbongo
  • 127

3 Answers3

10

(I assume you're talking about the Linux killall command.)

The option -9 is listed in a generic way under -SIGNAL. The description specified that

Signals can be specified either by name (e.g. -HUP or -SIGHUP) or by number (e.g. -1) or by option -s.

So you can use killall -9 or killall -s 9 to send signal number 9, killall -42 or killall -s 42 to send signal number 42, etc. You can use killall -KILL or killall -s KILL to send the KILL signal, etc.

On traditional and modern Unix systems and on most POSIX systems, signal number 9 is the kill signal. On many systems you can use kill -l 9 to list the signal name corresponding to number 9; in bash, kill -l lists the recognized signal names with their corresponding numbers.

7

This sends the SIGKILL (9) signal to all processes. A process can not intercept this signal, and is immediately killed. This means no process can clean up after itself, and even system critical processes will get killed with no contemplation.

Its single process kill -9 pid equivalent is very strongly discouraged for exactly the reason given above, killall is much more dangerous.

Always remember that Unix/Linux does exactly as told, even if the command is destructive. You, the system administrator, are in complete control. With awesome power comes great responsibility.

Stephen Kitt
  • 434,908
vonbrand
  • 18,253
4

It sends SIGKILL to an process (or multiple with killall).

SIGKILL - The SIGKILL signal forces the process to stop executing immediately. The program cannot ignore this signal. This process does not get to clean-up either.

http://www.linux.org/threads/kill-commands-and-signals.4423/

roxto
  • 728