kill
kill: send a signal to a process.
Synopsis
kill [-s signal | -signal] [–] pid…
kill -l
Description
kill sends a signal to each pid, SIGTERM unless another is given. A negative pid is a process group: every process in it gets the signal. Give it after – so it isn’t read as a signal.
A signal is a name, with or without its SIG prefix, in any case (-KILL, -sigint), or its number (-9). The signals mcos knows are SIGHUP (1), SIGINT (2), SIGKILL (9), SIGPIPE (13), SIGTERM (15) and SIGCHLD (17). SIGKILL cannot be caught or ignored: the process ends at once and runs none of its code.
Options
- -s signal, -signal
- The signal to send.
- -l
- Lists the signals, by number.
- –
- Ends the options: what follows is pids.
Exit status
0 if every signal was sent; 1 if any failed (no such process, a pid that isn’t a number, an unknown signal); 2 with no pid.
Examples
kill 12
kill -9 12 13
kill -s INT 7
kill -TERM -- -5
See also
ps(1), sh(1)