tags:

views:

363

answers:

2

killall -r -9 . sends the 9 signal to all processes matching the . regular expression (i.e. it kills all processes). As it kills itself, the question is, will it kill itself last, therefore doing what it is documented to do, or maybe it will kill himself before finishing the work, leaving processes alive.

Following @David's answer, it means that if you run killall twice it has less chances of working than if you run it once - because each killall can kill the other before it finishes working.

Is this a new paradox, akin to the halting problem?

+6  A: 

The man page says that killall will never kill itself.

David Zaslavsky
A: 

Why not

kill -9 -1

which kills all processes, in one shot?

Well, actually it kills everybody except init and itself, and of course if you run it as an unprivileged user you can only kill your own processes. But you don't have to worry about the "order" it kills in: it runs a single kill(-1, SIGKILL) syscall instead of iterating over various PIDs.

ephemient