File: kill.1

package info (click to toggle)
procps 2%3A4.0.6-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 14,424 kB
  • sloc: ansic: 32,770; sh: 5,995; exp: 775; makefile: 691; sed: 16
file content (211 lines) | stat: -rw-r--r-- 4,031 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
.\"
.\" Copyright (c) 2002-2024 Craig Small <csmall@dropbear.xyz>
.\" Copyright (c) 2011-2023 Jim Warner <james.warner@comcast.net>
.\" Copyright (c) 2011-2012 Sami Kerola <kerolasa@iki.fi>
.\" Copyright (c) 1998-2003 Albert Cahalan
.\"
.\" This program is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 2 of the License, or
.\" (at your option) any later version.
.\"
.TH KILL 1 2023-12-27 procps-ng
.SH NAME
kill \- send a signal to one or more processes
.SH SYNOPSIS
.B kill
.RB [ \-q\~\c
.IR value |\c
.BI \-\-queue \~value\c
]
.IR pid " .\|.\|."
.P
.B kill
.BI \- signal
.RB [ \-q\~\c
.IR value |\c
.BI \-\-queue \~value\c
]
.IR pid-or-pgid " .\|.\|."
.br
.B kill
.BI \-s \~signal
.RB [ \-q\~\c
.IR value |\c
.BI \-\-queue \~value\c
]
.IR pid-or-pgid " .\|.\|."
.br
.B kill
.BI \-\-signal \~signal
.RB [ \-q\~\c
.IR value |\c
.BI \-\-queue \~value\c
]
.IR pid-or-pgid " .\|.\|."
.P
.BR "kill \-l" \~[\c
.IR signal ]
.br
.BR "kill \-\-list" \~[\c
.IR signal ]
.P
.B "kill \-L"
.br
.B "kill \-\-table"
.SH DESCRIPTION
.B kill
sends a signal to one or more processes by
.I pid
or
.IR pgid ,
a process or process group identifier.
.BR signal (7)
explains the varieties and behavior of signals.
.BR kill 's
default signal is TERM.
The
.B \-l
and
.B \-L
options list available signals.
Particularly useful signals include HUP,
INT, KILL, STOP, CONT, and 0.
Specify signals
by number,
by name,
or by name with a \[lq]SIG\[rq] prefix;
for example,
.BR \-9 ,
.BR \-SIGKILL ,
and
.B \-KILL
are equivalent.
A negative operand selects a process group;
see the PGID column in
.BR ps (1)
command output.
A
.I pid
of
.B \-1
is special;
it indicates all processes except the
.B kill
process itself and
.BR init (8).
.P
The
.B \-q
option uses an alternative signaling method to
to additionally transmit an integral
.I value
to a receiving process.
If that process has installed a handler for the signal and specified the
SA_SIGINFO flag to
.BR sigaction (2),
then it can obtain this datum via the
.I \%si_value
field of the
.I \%siginfo_t
structure.
.SH OPTIONS
.TP
.BI \- signal
.TQ
.BI \-s \~signal
.TQ
.BI \-\-signal \~signal
Send
.I signal
by name or number as described above.
If
.I signal
is 0 (zero),
.B kill
sends no signal,
but still validates its operands;
this behavior permits the caller to check whether
the specified
.IR pid s
and/or
.IR pgid s
exist and it has permission to send them signals.
.TP
.BI \-q \~value
.TQ
.BI \-\-queue \~value
Use
.BR sigqueue (3)
rather than
.BR kill (2)
to additionally send
.I value
to each
.I pid
or
.IR pgid .
.TP
.BR \-l \~[\fIsignal\fR]
.TQ
.BR \-\-list \~[\\fIsignal\fR]
Without an argument,
list signal names.
The optional argument causes
.B kill
to convert the specified
.I signal
from name to numeric form,
or vice versa as appropriate,
and report the translation.
.TP
.B \-L
.TQ
.B \-\-table
List signal names in tabular format.
.SH NOTES
The shell (command-line interpreter) often has a built-in \[lq]kill\[rq]
command.
You may need to run the command described here as
.I /bin/\:kill
to override the shell built-in.
.PP
If you use a negative operand,
specify a signal by name or number first so that
.B kill
can distinguish it from a process group.
For example,
the command
.RB \[lq] "kill 123 \-9" \[rq]
is ambiguous;
it could mean to kill process 123 with signal 9,
or to kill process 123 and process group 9 with the default signal.
.SH EXAMPLES
.TP
.B kill \-HUP \-1
Send hangup signal to all the processes you can.
.TP
.B kill \-l 11
Report name corresponding to signal number 11.
.TP
.B kill 123 543
Send the default signal,
SIGTERM,
to processes 123 and
543.
.TP
.B kill -SIGTERM -123
Send the signal SIGTERM to process group 123.
.SH "SEE ALSO"
.BR kill (2),
.BR killall (1),
.BR nice (1),
.BR pkill (1),
.BR renice (1),
.BR signal (7),
.BR sigqueue (3),
.BR skill (1)
.SH "REPORTING BUGS"
Please send bug reports to
.MT procps@freelists.org
.ME .