How to Kill All Your Processes

Here’s a quick tip for killing your processes on Linux/UNIX:

kill -1 -1

The first -1 is the signal you are going to send and the second -1 means “every process”. The -1 signal is SIGHUP (hang up) which is basically a nice way of asking a process to terminate (or reload in some cases). The reason sending SIGHUP to every process works to kill only the processes of the account that ran the command is that not every process will respond signals from just anyone. Only processes running at the user who executes the above command will respond to it. Other users processes, including those running as root will not respond. Be careful however, running this as root will attempt to kill ALL processes.

Not all processes will respond to SIGHUP by exiting so sometimes more force is necessary:

kill -9 -1

The -9 signal is SIGKILL (kill program) which should take care of any pesky processes that don’t want to exit nicely.

And that’s that.

Leave a Reply

Your email address will not be published. Required fields are marked *