kill - send a signal to a process
kill [-SIGNAL] pid...
Options you will use
-l, --list- List the signal names.
-TERM, -15- Polite request to shut down. The default. Catchable - the process can clean up.
-KILL, -9- Kernel destroys the process. NOT catchable, no cleanup, no chance to flush.
-HUP, -1- Hang up. Daemons conventionally reload their config on this.
-INT, -2- What Ctrl+C sends.
-STOP, -CONT- Suspend (state T) and resume. STOP is not catchable either.
Gotchas
- kill -9 cannot touch a process in D state: the signal is only delivered when the process returns to userspace, and it never does until the I/O completes.
Taught in
Try kill in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.