Table of Contents

The kill builtin command

Synopsis

kill [-s SIGNAL | -n SIGNALNUMBER | -SIGNAL] PID|JOB
kill -l|-L [SIGNAL...]

Description

The kill command is used to send signals to processes specified by their PID or their JOB-specification.

The signal(s) to be specified can have the following formats:

Without any specified signal, the command sends the SIGTERM-signal.

The kill command is a Bash builtin command instead of relying on the external kill command of the operating system to

Options

Option Description
-s SIGNAL specifies the signal to send
-n SIGNALNUMBER specifies the signal to send
-SIGNAL specifies the signal to send
-l [SIGNAL…] Lists supported/known signal numbers and their symbolic name. If SIGNAL is given, only list this signal, translated (if a number is given the symbolic name is printed, and vice versa)
-L [SIGNAL…] Same as -l [SIGNAL] (compatiblity option)

Return status

Status Reason
0 no error/success
!=0 invalid option
!=0 invalid signal specification
!=0 error returned by the system function (e.g. insufficient permissions to send to a specific process)

Examples

List supported signals

kill -l

Send KILL to a process ID

kill -9 12345

kill -KILL 12345

kill -SIGKILL 12345

Portability considerations

See also