kill

terminate process

KornShell Built-in


SYNOPSIS

kill -l [exit_status]

kill [-s signal_name] [pid ...] [job-identifier ...]


DESCRIPTION

kill terminates a process by sending it a signal. The default signal is SIGTERM.

You may specify the following items on the command line:
-l [exit_status]

displays the names of all supported signals. If you specify exit_status, and it is the exit code of a terminated process, kill displays the terminating signal of that process.

-s signal_name

sends the signal signal_name to the process instead of the SIGTERM signal.

-signal_name

is an obsolete equivalent of -s signal_name.

-signal_number

is an obsolete method of specifying a positive integer which represents the signal to be used (instead of SIGTERM) as the sig argument in the effective call to kill. The relationship between signal_number and the portable signal_name is shown in Table 1, Integer Values of Signals.

signal_number signal_name
0 0
1 SIGHUP
2 SIGINT
3 SIGQUIT
6 SIGABRT
9 SIGKILL
14 SIGALRM
15 SIGTERM

Table 1: Integer Values of Signals

job-identifier

is the job identifier reported by the shell when a process is started with &. It is one way to identify a process. It is also reported by the jobs command.

pid

is the process ID that the shell reports when a process is started with &. You can also find the pid using the ps command.

The killed process must belong to the current user, unless he or she is the superuser.


DIAGNOSTICS

Possible exit status values are:
0

Successful completion.

1

The specified signal was invalid or there was exactly one job or process that could not be killed.

2

Failure due to an invalid command line argument or there were exactly two jobs or processes that could not be killed.

>2

Tells the number of jobs or processes that could not be killed.

Possible error messages include:
"job-identifier" is not a job

You specified a job-identifier that is not valid.

"signal_name" is not a valid signal

You specified a non-integer signal for kill or a signal that is outside the range of valid signal numbers.


PORTABILITY

POSIX.2. x/OPEN Portability Guide 4.0.

kill is provided as both an external utility and a built-in MKS KornShell utility.


SEE ALSO

Commands:
jobs, ps, sh


Updated MKS Toolkit [3khat16.ico]HP3000 [3khat16.ico]3kMail [archive16.gif]