Decode Flags for Kill Command
Under Linux try man 7 signal
.
kill -HUP 1234
means "send the SIGHUP signal (1) to process 1234", so it's equivalent to kill -1 1234
. The default signal that is sent by kill is SIGTERM (15), so kill 1234
is equivalent to kill -TERM 1234
or kill -15 1234
.
-HUP
isn't the three flags H
, U
, P
as in the common single-letter option syntax. For historical reasons, the kill
command takes an optional signal name or signal number preceded by a dash (-
).
kill -1 1234
kill -HUP 1234
(As opposed to kill 1 1234
, which would send the default signal (SIGTERM) to processes 1 and 1234.)
Your man page probably lists something like this:
kill [ -signal | -s signal ] pid ...
That -signal
means that you can use a dash followed by a signal designation (which can be a name or number). Alternatively, you can use the -s
option followed by a signal name; these are two different syntaxes with the same meaning.
kill -l
lists the available signal names and the corresponding numbers.
Most signals have a predefined meaning based on who sends them when and how processes are supposed and able to react to them.