<s>
In	O
computing	O
,	O
kill	O
is	O
a	O
command	B-Application
that	O
is	O
used	O
in	O
several	O
popular	O
operating	B-General_Concept
systems	I-General_Concept
to	O
send	O
signals	B-Operating_System
to	O
running	O
processes	B-Operating_System
.	O
</s>
<s>
In	O
Unix	B-Application
and	O
Unix-like	B-Operating_System
operating	I-Operating_System
systems	I-Operating_System
,	O
kill	O
is	O
a	O
command	B-Application
used	O
to	O
send	O
a	O
signal	B-Operating_System
to	O
a	O
process	O
.	O
</s>
<s>
By	O
default	O
,	O
the	O
message	O
sent	O
is	O
the	O
termination	B-General_Concept
signal	I-General_Concept
,	O
which	O
requests	O
that	O
the	O
process	O
exit	B-Operating_System
.	O
</s>
<s>
But	O
kill	O
is	O
something	O
of	O
a	O
misnomer	O
;	O
the	O
signal	B-Operating_System
sent	O
may	O
have	O
nothing	O
to	O
do	O
with	O
process	O
killing	O
.	O
</s>
<s>
The	O
kill	B-Operating_System
command	I-Operating_System
is	O
a	O
wrapper	O
around	O
the	O
kill( )	O
system	B-Operating_System
call	I-Operating_System
,	O
which	O
sends	O
signals	B-Operating_System
to	O
processes	B-Operating_System
or	O
process	B-Operating_System
groups	I-Operating_System
on	O
the	O
system	O
,	O
referenced	O
by	O
their	O
numeric	O
process	B-Operating_System
IDs	I-Operating_System
(	O
PIDs	O
)	O
or	O
process	B-Operating_System
group	I-Operating_System
IDs	I-Operating_System
(	O
PGIDs	O
)	O
.	O
</s>
<s>
However	O
,	O
most	O
shells	B-Application
have	O
built-in	O
kill	B-Operating_System
commands	I-Operating_System
that	O
may	O
slightly	O
differ	O
from	O
it	O
.	O
</s>
<s>
There	O
are	O
many	O
different	O
signals	B-Operating_System
that	O
can	O
be	O
sent	O
(	O
see	O
signal	B-Operating_System
for	O
a	O
full	O
list	O
)	O
,	O
although	O
the	O
signals	B-Operating_System
in	O
which	O
users	O
are	O
generally	O
most	O
interested	O
are	O
SIGTERM	B-General_Concept
(	O
"	O
terminate	B-Operating_System
"	O
)	O
and	O
SIGKILL	B-General_Concept
(	O
"	O
kill	O
"	O
)	O
.	O
</s>
<s>
The	O
default	O
signal	B-Operating_System
sent	O
is	O
SIGTERM	B-General_Concept
.	O
</s>
<s>
Programs	O
that	O
handle	O
this	O
signal	B-Operating_System
can	O
do	O
useful	O
cleanup	O
operations	O
(	O
such	O
as	O
saving	O
configuration	O
information	O
to	O
a	O
file	O
)	O
before	O
quitting	O
.	O
</s>
<s>
However	O
,	O
many	O
programs	O
do	O
not	O
implement	O
a	O
special	O
handler	O
for	O
this	O
signal	B-Operating_System
,	O
and	O
so	O
a	O
default	O
signal	B-Operating_System
handler	I-Operating_System
is	O
called	O
instead	O
.	O
</s>
<s>
Other	O
times	O
,	O
even	O
a	O
process	O
that	O
has	O
a	O
special	O
handler	O
has	O
gone	O
awry	O
in	O
a	O
way	O
that	O
prevents	O
it	O
from	O
properly	O
handling	O
the	O
signal	B-Operating_System
.	O
</s>
<s>
All	O
signals	B-Operating_System
except	O
for	O
SIGKILL	B-General_Concept
and	O
SIGSTOP	B-General_Concept
(	O
"	O
stop	O
"	O
)	O
can	O
be	O
"	O
intercepted	O
"	O
by	O
the	O
process	O
,	O
meaning	O
that	O
a	O
special	O
function	O
can	O
be	O
called	O
when	O
the	O
program	O
receives	O
those	O
signals	B-Operating_System
.	O
</s>
<s>
The	O
two	O
exceptions	O
SIGKILL	B-General_Concept
and	O
SIGSTOP	B-General_Concept
are	O
only	O
seen	O
by	O
the	O
host	O
system	O
's	O
kernel	B-Operating_System
,	O
providing	O
reliable	O
ways	O
of	O
controlling	O
the	O
execution	O
of	O
processes	B-Operating_System
.	O
</s>
<s>
SIGKILL	B-General_Concept
kills	O
the	O
process	O
,	O
and	O
SIGSTOP	B-General_Concept
pauses	O
it	O
until	O
a	O
SIGCONT	B-General_Concept
(	O
"	O
continue	O
"	O
)	O
is	O
received	O
.	O
</s>
<s>
Unix	B-Application
provides	O
security	O
mechanisms	O
to	O
prevent	O
unauthorized	O
users	O
from	O
killing	O
other	O
processes	B-Operating_System
.	O
</s>
<s>
Essentially	O
,	O
for	O
a	O
process	O
to	O
send	O
a	O
signal	B-Operating_System
to	O
another	O
,	O
the	O
owner	O
of	O
the	O
signaling	O
process	O
must	O
be	O
the	O
same	O
as	O
the	O
owner	O
of	O
the	O
receiving	O
process	O
or	O
be	O
the	O
superuser	B-Application
.	O
</s>
<s>
The	O
available	O
signals	B-Operating_System
all	O
have	O
different	O
names	O
,	O
and	O
are	O
mapped	O
to	O
certain	O
numbers	O
.	O
</s>
<s>
It	O
is	O
important	O
to	O
note	O
that	O
the	O
specific	O
mapping	O
between	O
numbers	O
and	O
signals	B-Operating_System
can	O
vary	O
between	O
Unix	B-Application
implementations	O
.	O
</s>
<s>
SIGTERM	B-General_Concept
is	O
often	O
numbered	O
15	O
while	O
SIGKILL	B-General_Concept
is	O
often	O
numbered	O
9	O
.	O
</s>
<s>
A	O
process	O
can	O
be	O
sent	O
a	O
SIGTERM	B-General_Concept
signal	B-Operating_System
in	O
four	O
ways	O
(	O
the	O
process	B-Operating_System
ID	I-Operating_System
is	O
'	O
1234	O
 '	O
in	O
this	O
case	O
)	O
:	O
</s>
<s>
The	O
process	O
can	O
be	O
sent	O
a	O
SIGKILL	B-General_Concept
signal	B-Operating_System
in	O
three	O
ways	O
:	O
</s>
<s>
Other	O
useful	O
signals	B-Operating_System
include	O
HUP	O
,	O
TRAP	O
,	O
INT	O
,	O
SEGV	B-Error_Name
and	O
ALRM	O
.	O
</s>
<s>
HUP	O
sends	O
the	O
SIGHUP	B-General_Concept
signal	B-Operating_System
.	O
</s>
<s>
Some	O
daemons	O
,	O
including	O
Apache	B-Application
and	O
Sendmail	B-Application
,	O
re-read	O
configuration	B-Protocol
files	I-Protocol
upon	O
receiving	O
SIGHUP	B-General_Concept
,	O
so	O
the	O
kill	B-Operating_System
command	I-Operating_System
may	O
be	O
used	O
for	O
this	O
too	O
.	O
</s>
<s>
A	O
SIGINT	B-General_Concept
signal	B-Operating_System
can	O
be	O
generated	O
very	O
simply	O
by	O
pressing	O
in	O
most	O
Unix	B-Application
shells	I-Application
.	O
</s>
<s>
It	O
is	O
also	O
common	O
for	O
to	O
be	O
mapped	O
to	O
SIGTSTP	B-General_Concept
(	O
"	O
terminal	O
stop	O
"	O
)	O
,	O
and	O
for	O
(	O
backslash	O
)	O
to	O
be	O
mapped	O
to	O
SIGQUIT	B-General_Concept
,	O
which	O
can	O
force	O
a	O
program	O
to	O
do	O
a	O
core	B-Error_Name
dump	I-Error_Name
.	O
</s>
<s>
killall	B-Device
-	O
on	O
some	O
variations	O
of	O
Unix	B-Application
,	O
such	O
as	O
Solaris	B-Application
,	O
this	O
utility	O
is	O
automatically	O
invoked	O
when	O
the	O
system	O
is	O
going	O
through	O
a	O
shutdown	B-Device
.	O
</s>
<s>
It	O
behaves	O
much	O
like	O
the	O
kill	B-Operating_System
command	I-Operating_System
above	O
,	O
but	O
instead	O
of	O
sending	O
a	O
signal	B-Operating_System
to	O
an	O
individual	O
process	O
,	O
the	O
signal	B-Operating_System
is	O
sent	O
to	O
all	O
processes	B-Operating_System
on	O
the	O
system	O
.	O
</s>
<s>
However	O
,	O
on	O
others	O
such	O
as	O
IRIX	B-Operating_System
,	O
Linux	B-Application
,	O
and	O
FreeBSD	B-Operating_System
,	O
an	O
argument	O
is	O
supplied	O
specifying	O
the	O
name	O
of	O
the	O
process	O
(	O
or	O
processes	B-Operating_System
)	O
to	O
kill	O
.	O
</s>
<s>
For	O
instance	O
,	O
to	O
kill	O
a	O
process	O
such	O
as	O
an	O
instance	O
of	O
the	O
XMMS	B-Language
music	O
player	O
invoked	O
by	O
xmms	B-Language
,	O
the	O
user	O
would	O
run	O
the	O
command	B-Application
killall	B-Device
xmms	B-Language
.	O
</s>
<s>
This	O
would	O
kill	O
all	O
processes	B-Operating_System
named	O
xmms	B-Language
,	O
and	O
is	O
equivalent	O
to	O
kill	O
`pidof	O
xmms`	O
on	O
systems	O
like	O
Solaris	B-Application
.	O
</s>
<s>
pkill	B-Device
-	O
signals	B-Operating_System
processes	B-Operating_System
based	O
on	O
name	O
and	O
other	O
attributes	O
.	O
</s>
<s>
It	O
was	O
introduced	O
in	O
Solaris	B-Application
7	I-Application
and	O
has	O
since	O
been	O
reimplemented	O
for	O
Linux	B-Application
,	O
NetBSD	B-Device
and	O
OpenBSD	B-Operating_System
.	O
</s>
<s>
pkill	B-Device
makes	O
killing	O
processes	B-Operating_System
based	O
on	O
their	O
name	O
much	O
more	O
convenient	O
:	O
e.g.	O
</s>
<s>
to	O
kill	O
a	O
process	O
named	O
firefox	O
without	O
pkill	B-Device
(	O
and	O
without	O
pgrep	B-Device
)	O
,	O
one	O
would	O
have	O
to	O
type	O
kill	O
`ps	O
--no-headers	O
-C	O
firefox	O
-o	O
pid`	O
whereas	O
with	O
pkill	B-Device
,	O
one	O
can	O
simply	O
type	O
pkill	B-Device
firefox	O
.	O
</s>
<s>
xkill	B-Application
-	O
if	O
called	O
without	O
any	O
parameters	O
,	O
the	O
mouse	O
cursor	O
changes	O
from	O
an	O
arrow	O
to	O
an	O
"	O
x	O
"	O
icon	O
,	O
and	O
the	O
user	O
can	O
click	O
on	O
a	O
window	O
to	O
force	O
the	O
X	O
server	O
to	O
close	O
the	O
connection	O
with	O
the	O
client	O
owning	O
the	O
window	O
.	O
</s>
<s>
This	O
often	O
causes	O
the	O
process	O
to	O
terminate	B-Operating_System
when	O
it	O
detects	O
that	O
its	O
connection	O
to	O
the	O
X	O
server	O
has	O
been	O
closed	O
.	O
</s>
<s>
The	O
kill	B-Operating_System
command	I-Operating_System
is	O
also	O
available	O
as	O
a	O
shell	B-Operating_System
builtin	O
in	O
the	O
OS-9	B-Operating_System
shell	B-Operating_System
.	O
</s>
<s>
It	O
is	O
used	O
to	O
kill	O
another	O
process	O
by	O
process	B-Operating_System
ID	I-Operating_System
.	O
</s>
<s>
Stop	O
the	O
process	O
with	O
the	O
process	B-Operating_System
ID	I-Operating_System
"	O
7	B-Device
"	O
:	O
</s>
<s>
In	O
Microsoft	O
's	O
command-line	O
interpreter	O
Windows	B-Application
PowerShell	I-Application
,	O
kill	O
is	O
a	O
predefined	O
command	B-Device
alias	I-Device
for	O
the	O
Stop-Process	O
cmdlet	O
.	O
</s>
<s>
Microsoft	B-Application
Windows	I-Application
XP	I-Application
,	O
Vista	B-Application
and	O
7	B-Device
include	O
the	O
command	B-Application
taskkill	O
to	O
terminate	B-Operating_System
processes	B-Operating_System
.	O
</s>
<s>
The	O
usual	O
syntax	O
for	O
this	O
command	B-Application
is	O
taskkill	O
/im	O
"	O
IMAGENAME	O
"	O
.	O
</s>
<s>
An	O
"	O
unsupported	O
"	O
version	O
of	O
kill	O
was	O
included	O
in	O
several	O
releases	O
of	O
the	O
Microsoft	B-Application
Windows	I-Application
Resource	O
Kits	O
available	O
for	O
Windows	B-Application
98	O
.	O
</s>
<s>
GNU	B-Operating_System
versions	O
of	O
kill	O
have	O
been	O
ported	O
via	O
Cygwin	B-Language
and	O
run	O
inside	O
of	O
the	O
Unix	B-Application
environment	O
subsystem	O
that	O
Microsoft	B-Application
Windows	I-Application
Services	O
for	O
UNIX	B-Application
provides	O
(	O
Microsoft	O
acquired	O
Windows	B-Application
Services	O
for	O
Unix	B-Application
wholesale	O
via	O
their	O
purchase	O
of	O
Softway	B-Operating_System
Systems	I-Operating_System
and	O
their	O
Interix	B-Operating_System
product	O
on	O
September	O
17	O
,	O
1999	O
)	O
.	O
</s>
<s>
The	O
ReactOS	B-Application
implementation	O
is	O
based	O
on	O
the	O
Windows	B-Application
variant	O
.	O
</s>
<s>
It	O
is	O
licensed	O
under	O
the	O
LGPLv2.1	B-Application
or	O
later	O
.	O
</s>
<s>
Find	O
all	O
processes	B-Operating_System
beginning	O
with	O
the	O
letter	O
"	O
p	O
"	O
that	O
were	O
developed	O
by	O
Microsoft	O
and	O
use	O
more	O
than	O
10	O
MB	O
of	O
memory	O
and	O
kill	O
them	O
:	O
</s>
<s>
Here	O
is	O
a	O
simpler	O
example	O
,	O
which	O
asks	O
the	O
process	O
Explorer.exe	B-Protocol
to	O
terminate	B-Operating_System
:	O
</s>
<s>
This	O
example	O
forces	O
the	O
process	O
to	O
terminate	B-Operating_System
:	O
</s>
<s>
Processes	B-Operating_System
can	O
also	O
be	O
killed	O
by	O
their	O
PID	B-Operating_System
number	I-Operating_System
:	O
</s>
<s>
Singularity	B-Operating_System
shell	I-Operating_System
,	O
the	O
standard	O
shell	B-Operating_System
for	O
Microsoft	O
Research	O
's	O
microkernel	B-Operating_System
operating	B-General_Concept
system	I-General_Concept
Singularity	B-Operating_System
includes	O
a	O
kill	B-Operating_System
command	I-Operating_System
to	O
terminate	B-Operating_System
background	O
processes	B-Operating_System
.	O
</s>
<s>
Stop	O
the	O
process	O
with	O
the	O
process	B-Operating_System
identifier	I-Operating_System
"	O
42	O
"	O
:	O
</s>
<s>
Under	O
Plan	B-Operating_System
9	I-Operating_System
from	I-Operating_System
Bell	I-Operating_System
Labs	I-Operating_System
,	O
the	O
kill	O
program	O
does	O
not	O
actually	O
perform	O
this	O
termination	O
,	O
nor	O
does	O
it	O
take	O
process	B-Operating_System
IDs	I-Operating_System
.	O
</s>
<s>
Rather	O
,	O
it	O
takes	O
the	O
actual	O
names	O
of	O
processes	B-Operating_System
and	O
outputs	O
the	O
commands	O
for	O
rc	B-Operating_System
,	O
the	O
shell	B-Operating_System
used	O
by	O
Plan	B-Operating_System
9	I-Operating_System
,	O
to	O
kill	O
the	O
process	O
.	O
</s>
<s>
A	O
similar	O
command	B-Application
provided	O
is	O
called	O
slay	O
,	O
which	O
does	O
the	O
same	O
but	O
for	O
processes	B-Operating_System
that	O
refuse	O
to	O
be	O
killed	O
this	O
way	O
.	O
</s>
<s>
For	O
example	O
,	O
to	O
kill	O
all	O
instances	O
of	O
troff	B-Language
,	O
one	O
types	O
:	O
</s>
<s>
The	O
command	B-Application
has	O
also	O
been	O
ported	O
to	O
the	O
IBM	B-Application
i	I-Application
operating	B-General_Concept
system	I-General_Concept
.	O
</s>
