Merge commit '7e3488dc6cdcb0c04e1ce167a1a3bfef83b5f2e0'
[unleashed.git] / bin / kill / kill.1
blob172f87842aff17633efcfc3d792f5a6d67ebc57a
1 .\"     $OpenBSD: kill.1,v 1.39 2016/08/16 18:51:25 schwarze 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: August 16 2016 $
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 .Nm kill
47 .Fl l
48 .Op Ar exit_status
49 .Nm kill
50 .Fl Ar signal_name
51 .Ar pid ...
52 .Nm kill
53 .Fl Ar signal_number
54 .Ar pid ...
55 .Sh DESCRIPTION
56 The
57 .Nm
58 utility sends a signal to the process(es) specified
59 by the
60 .Ar pid
61 operand(s).
62 If no signal is specified,
63 .Dv SIGTERM
64 is used.
65 .Pp
66 Only the superuser may send signals to other users' processes.
67 .Pp
68 The options are as follows:
69 .Bl -tag -width Ds
70 .It Fl l Op Ar exit_status
71 Display the name of the signal corresponding to
72 .Ar exit_status .
73 .Ar exit_status
74 may be the exit status of a command killed by a signal
75 (see the
76 special
77 .Xr sh 1
78 parameter
79 .Sq ?\& )
80 or a signal number.
81 .Pp
82 If no operand is given, display the names of all the signals.
83 .It Fl s Ar signal_name
84 A symbolic signal name specifying the signal to be sent instead of the
85 default
86 .Dv SIGTERM .
87 .It Fl Ar signal_name
88 A symbolic signal name specifying the signal to be sent instead of the
89 default
90 .Dv SIGTERM .
91 .It Fl Ar signal_number
92 A non-negative decimal integer specifying the signal to be sent instead
93 of the default
94 .Dv SIGTERM .
95 .El
96 .Pp
97 The following PIDs have special meanings:
98 .Bl -tag -width Ds -offset indent
99 .It \-1
100 If superuser, broadcast the signal to all processes; otherwise, broadcast
101 to all processes belonging to the user.
102 .It 0
103 Send the signal to all processes whose group ID is equal to the
104 process group ID of the sender, and for which the process has permission.
105 .It \- Ns Ar pgid
106 Send the signal to all processes within the specified process group.
109 Some of the more commonly used signals:
111 .Bl -tag -width Ds -compact -offset indent
112 .It 1
113 HUP (hang up)
114 .It 2
115 INT (interrupt)
116 .It 3
117 QUIT (quit)
118 .It 6
119 ABRT (abort)
120 .It 9
121 KILL (non-catchable, non-ignorable kill)
122 .It 14
123 ALRM (alarm clock)
124 .It 15
125 TERM (software termination signal)
128 For a more complete list, consult the
129 .Xr sigaction 2
130 manual page.
132 A signal number of 0
133 .Pq Li kill \-0 pid
134 checks the validity of a certain PID, to see if it exists.
135 An exit code of 0 means that the specified process exists.
136 .Sh EXIT STATUS
137 .Ex -std kill
138 .Sh EXAMPLES
139 Forcibly terminate process ID 1234:
141 .Dl $ kill -9 1234
143 Send the
144 .Xr init 8
145 process the hangup signal, instructing it to re-read
146 .Xr ttys 5 :
148 .Dl # kill -HUP 1
149 .Sh SEE ALSO
150 .Xr csh 1 ,
151 .Xr ksh 1 ,
152 .Xr pkill 1 ,
153 .Xr ps 1 ,
154 .Xr kill 2 ,
155 .Xr sigaction 2
156 .Sh STANDARDS
159 utility is compliant with the
160 .St -p1003.1-2008
161 specification.
164 .Fl Ar signal_name
166 .Fl Ar signal_number
167 syntax is marked by
168 .St -p1003.1-2008
169 as being an
170 X/Open System Interfaces
171 option.
174 also exists as a built-in to
175 .Xr csh 1
177 .Xr ksh 1 ,
178 though with a different syntax.
179 .Sh HISTORY
182 command appeared in
183 .At v3
184 in section 8 of the manual.