The kill utility sends a signal to the process or processes specified by each pid operand.
For each pid operand, the kill utility will perform actions equivalent to the kill(2) function called with the following arguments:
The value of the pid operand will be used as the pid argument.
The sig argument is the value specified by the -s option, or by
SIGTERM, if none of these options is specified.
The signaled process must belong to the current user unless the user is the super-user.
See NOTES for descriptions of the shell built-in versions of kill.
The following options are supported:
(The letter ell.) Write all values of signal supported by the implementation, if no operand is given. If an exit_status operand is given and it is a value of the ? shell special parameter and wait corresponding to a process that was terminated by a signal, the signal corresponding to the signal that terminated the process will be written. If an exit_status operand is given and it is the unsigned decimal integer value of a signal number, the signal corresponding to that signal will be written. Otherwise, the results are unspecified.
Specify the signal to send, using one of the symbolic names defined in the <signal.h> description. Values of signal will be recognized in a case-independent fashion, without the SIG prefix. In addition, the symbolic name 0 will be recognized, representing the signal value zero. The corresponding signal will be sent instead of SIGTERM.
The following operands are supported:
A decimal integer specifying a process or process group to be signaled. The process or processes selected by positive, negative and zero values of the pid operand will be as described for the kill function. If process number 0 is specified, all processes in the process group are signaled. If the first pid operand is negative, it should be preceded by - - to keep it from being interpreted as an option.
A job control job ID that identifies a background process group to be signaled. The job control job ID notation is applicable only for invocations of kill in the current shell execution environment.
Note the job control job ID type of pid is available only on systems supporting the job control option.
A decimal integer specifying a signal number or the exit status of a process terminated by a signal.
Process numbers can be found by using ps(1).
nohup kill %1 & system( "kill %1");
kill operates in a different environment and will not share the shell's understanding of job numbers.
When the -l option is not specified, the standard output will not be used.
When the -l option is specified, the symbolic name of each signal will be written in the following format:
"%s%c", <signal>, <separator>
where the <signal> is in upper-case, without the SIG prefix, and the <separator> will be either a newline character or a space character. For the last signal written, <separator> will be a newline character.
When both the -l option and exit_status operand are specified, the symbolic name of the corresponding signal will be written in the following format:
Any of the commands:
kill -9 100 -165 kill -s kill 100 -165 kill -s KILL 100 -165
To avoid an ambiguity of an initial negative number argument specifying either a signal number or a process group, the former will always be the case. Therefore, to send the default signal to a process group (for example, 123), an application should use a command similar to one of the following:
kill -TERM -123 kill -- -123
See environ(5) for descriptions of the following environment variables that affect the execution of kill: LC_CTYPE, LC_MESSAGES, and NLSPATH.
The following exit values are returned:
At least one matching process was found for each pid operand, and the specified signal was successfully processed for at least one matching process.
An error occurred.
See attributes(5) for descriptions of the following attributes:
|ATTRIBUTE TYPE||ATTRIBUTE VALUE|
kill [ -sig ] [ pid ] [ %job ]... kill -l
kill [-sig][pid][%job]... kill -l
List the signal names that can be sent.
kill [-sig][pid][%job]... kill -l