The kill Command

When you use the kill command with a process, you stop whatever that process is doing. One hazard with commands of this nature is that if you are using a program like the vi editor and you kill it, you may lose your work as a result.

Although the kill command is mainly used to end a process, it can also be used to send signals to a process. Signals can be sent to indicate an action. There are actually many signals that you can use with the kill command. If you use the kill command with the –l option, you can see a list of everything that Unix can signal with:

 >kill -l 1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP 6) SIGIOT 7) SIGBUS 8) SIGFPE 9) SIGKILL 10) SIGUSR1 11) SIGSEGV 12) SIGUSR2 13) SIGPIPE 14) SIGALRM 15) SIGTERM ...

Get SAMS Teach Yourself Unix in 10 Minutes now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.