[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
23.1 kill
: Send a signal to processesSending a signal to processes.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
kill
: Send a signal to processes
The kill
command sends a signal to processes, causing them
to terminate or otherwise act upon receiving the signal in some way.
Alternatively, it lists information about signals. Synopses:
kill [-s signal | --signal signal | -signal] pid... kill [-l | --list | -t | --table] [signal]... |
The first form of the kill
command sends a signal to all
pid arguments. The default signal to send if none is specified
is `TERM'. The special signal number `0' does not denote a
valid signal, but can be used to test whether the pid arguments
specify processes to which a signal could be sent.
If pid is positive, the signal is sent to the process with the process id pid. If pid is zero, the signal is sent to all processes in the process group of the current process. If pid is -1, the signal is sent to all processes for which the user has permission to send a signal. If pid is less than -1, the signal is sent to all processes in the process group that equals the absolute value of pid.
If pid is not positive, a system-dependent set of system processes is excluded from the list of processes to which the signal is sent.
If a negative PID argument is desired as the first one, either a signal must be specified as well, or the option parsing must be interrupted with `--' before the first pid argument. The following three commands are equivalent:
kill -15 -1 kill -TERM -1 kill -- -1 |
The first form of the kill
command succeeds if every pid
argument specifies at least one process that the signal was sent to.
The second form of the kill
command lists signal information.
Either the `-l' or `--list' option, or the `-t'
or `--table' option must be specified. Without any
signal argument, all supported signals are listed. The output
of `-l' or `--list' is a list of the signal names, one
per line; if signal is already a name, the signal number is
printed instead. The output of `-t' or `--table' is a
table of signal numbers, names, and descriptions. This form of the
kill
command succeeds if all signal arguments are valid
and if there is no output error.
The kill
command also supports the `--help' and
`--version' options. See section 2. Common options.
A signal may be a signal name like `HUP', or a signal number like `1', or an exit status of a process terminated by the signal. A signal name can be given in canonical form or prefixed by `SIG'. The case of the letters is ignored, except for the `-signal' option which must use upper case to avoid ambiguity with lower case option letters. The following signal names and numbers are supported on all POSIX compliant systems:
Other supported signal names have system-dependent corresponding numbers. All systems conforming to POSIX 1003.1-2001 also support the following signals:
POSIX 1003.1-2001 systems that support the XSI extension also support the following signals:
POSIX 1003.1-2001 systems that support the XRT extension also support at least eight real-time signals called `RTMIN', `RTMIN+1', ..., `RTMAX-1', `RTMAX'.
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |