1.\" $OpenBSD: kill.1,v 1.26 2004/07/06 13:32:44 jmc Exp $ 2.\" $NetBSD: kill.1,v 1.8 1995/09/07 06:30:26 jtc Exp $ 3.\" 4.\" Copyright (c) 1980, 1990, 1993 5.\" The Regents of the University of California. All rights reserved. 6.\" 7.\" This code is derived from software contributed to Berkeley by 8.\" the Institute of Electrical and Electronics Engineers, Inc. 9.\" 10.\" Redistribution and use in source and binary forms, with or without 11.\" modification, are permitted provided that the following conditions 12.\" are met: 13.\" 1. Redistributions of source code must retain the above copyright 14.\" notice, this list of conditions and the following disclaimer. 15.\" 2. Redistributions in binary form must reproduce the above copyright 16.\" notice, this list of conditions and the following disclaimer in the 17.\" documentation and/or other materials provided with the distribution. 18.\" 3. Neither the name of the University nor the names of its contributors 19.\" may be used to endorse or promote products derived from this software 20.\" without specific prior written permission. 21.\" 22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32.\" SUCH DAMAGE. 33.\" 34.\" @(#)kill.1 8.2 (Berkeley) 4/28/95 35.\" 36.Dd $Mdocdate: February 11 2011 $ 37.Dt KILL 1 38.Os 39.Sh NAME 40.Nm kill 41.Nd terminate or signal a process 42.Sh SYNOPSIS 43.Nm kill 44.Op Fl s Ar signal_name 45.Ar pid 46.Op Ar ... 47.Nm kill 48.Fl l 49.Op Ar exit_status 50.Nm kill 51.Fl Ar signal_name 52.Ar pid 53.Op Ar ... 54.Nm kill 55.Fl Ar signal_number 56.Ar pid 57.Op Ar ... 58.Sh DESCRIPTION 59The 60.Nm 61utility sends a signal to the process(es) specified 62by the 63.Ar pid 64operand(s). 65If no signal is specified, 66.Dv SIGTERM 67is used. 68.Pp 69Only the superuser may send signals to other users' processes. 70.Pp 71The options are as follows: 72.Bl -tag -width Ds 73.It Fl s Ar signal_name 74A symbolic signal name specifying the signal to be sent instead of the 75default 76.Dv SIGTERM . 77.It Fl l Op Ar exit_status 78If no operand is given, list the signal names; otherwise, write 79the signal name corresponding to 80.Ar exit_status . 81.It Fl Ar signal_name 82A symbolic signal name specifying the signal to be sent instead of the 83default 84.Dv SIGTERM . 85.It Fl Ar signal_number 86A non-negative decimal integer specifying the signal to be sent instead 87of the default 88.Dv SIGTERM . 89.El 90.Pp 91The following PIDs have special meanings: 92.Bl -tag -width Ds -offset indent 93.It \-1 94If superuser, broadcast the signal to all processes; otherwise, broadcast 95to all processes belonging to the user. 96.It \- Ns Ar pgid 97Send the signal to all processes within the specified process group. 98.El 99.Pp 100Some of the more commonly used signals: 101.Pp 102.Bl -tag -width Ds -compact -offset indent 103.It 1 104HUP (hang up) 105.It 2 106INT (interrupt) 107.It 3 108QUIT (quit) 109.It 6 110ABRT (abort) 111.It 9 112KILL (non-catchable, non-ignorable kill) 113.It 14 114ALRM (alarm clock) 115.It 15 116TERM (software termination signal) 117.El 118.Pp 119For a more complete list, consult the 120.Xr sigaction 2 121manual page. 122.Pp 123A signal number of 0 124.Pq Li kill \-0 pid 125checks the validity of a certain PID, to see if it exists. 126An exit code of 0 means that the specified process exists. 127.Pp 128The 129.Nm 130utility exists as a built-in to most shells; 131they allow job specifiers of the form 132.Dq %... 133as arguments, 134so process IDs are not as often used as 135.Nm 136arguments. 137.Sh EXAMPLES 138Forcibly terminate process ID 1234: 139.Pp 140.Dl $ kill -9 1234 141.Pp 142Send the 143.Xr inetd 8 144daemon the hangup signal, instructing it to re-read its configuration from 145.Pa /etc/inetd.conf : 146.Pp 147.Dl $ sudo kill -HUP $(cat /var/run/inetd.pid) 148.Sh SEE ALSO 149.Xr csh 1 , 150.Xr pkill 1 , 151.Xr ps 1 , 152.Xr sh 1 , 153.Xr kill 2 , 154.Xr sigaction 2 155.Sh STANDARDS 156The 157.Nm 158utility is expected to be 159.St -p1003.2 160compatible. 161.Sh HISTORY 162A 163.Nm 164command appeared in 165.At v3 . 166It is actually an 167.Nm mksh 168builtin in 169.Mx 11 . 170