One of the most useful UNIX commands around. When most people think about kill, they think about in the -9 or -15 sense, which actually terminates the process in question. But there is so much more you can do with kill.

Many programs let you change their behavior by signaling them. For example, inetd and httpd will re-read their configuration files if you send them SIGHUP, which looks like:

kill -1 PID

init will do different things on SIGHUP, SIGUSR1, SIGINT, and SIGWINCH.

My favorite "alternative kill signals" are SIGSTOP and SIGCONT. I work in a computational chemistry lab where we do a lot of number crunching. From time to time I will want to run a job on a machine and find that there are already jobs running there. While I could be a complete bastard and become root and kill the offending process(es), I prefer (as do my colleagues) to become root and do:

kill -19 PID

This effectively "pauses" the process in question, allowing me to run my job right away. When I am done, I just:

kill -18 PID

and the "paused" job continues merrily on its way. Usually the owner of the process is none the wiser.

So lets not pigeon-hole the kill command as the serial murderer of the UNIX world, and instead realize its potential for much more devious and less destructive uses.

For a full listing of the signal numbers for kill try:

rangek@pinot-noir rangek $ kill -l 1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL
5) SIGTRAP 6) SIGABRT 7) SIGBUS 8) SIGFPE 9) SIGKILL 10) SIGUSR1 11) SIGSEGV 12) SIGUSR2 13) SIGPIPE 14) SIGALRM 15) SIGTERM 17) SIGCHLD 18) SIGCONT 19) SIGSTOP 20) SIGTSTP 21) SIGTTIN 22) SIGTTOU 23) SIGURG 24) SIGXCPU 25) SIGXFSZ 26) SIGVTALRM 27) SIGPROF 28) SIGWINCH 29) SIGIO 30) SIGPWR