]> git.ipfire.org Git - thirdparty/util-linux.git/blame - misc-utils/kill.1
Place SEE ALSO entries in order
[thirdparty/util-linux.git] / misc-utils / kill.1
CommitLineData
6dbe3af9
KZ
1.\" Copyright 1994 Salvatore Valente (svalente@mit.edu)
2.\" Copyright 1992 Rickard E. Faith (faith@cs.unc.edu)
3.\" May be distributed under the GNU General Public License
83098262 4.TH KILL 1 "July 2014" "util-linux" "User Commands"
6dbe3af9
KZ
5.SH NAME
6kill \- terminate a process
7.SH SYNOPSIS
b0315e1f 8.B kill
83098262
BS
9.RB [ \- \fIsignal\fR| \-s
10.IR signal | \fB-p\fP ]
a1504d8b 11.RB [ \-q
83098262 12.IR value ]
821ac2c7 13.RB [ \-a ]
b0315e1f 14.RB [ \-\- ]
83098262 15.IR pid | name ...
6dbe3af9 16.br
83098262
BS
17.B kill \-l
18.RI [ number ]
19.RB "| " \-L
6dbe3af9 20.SH DESCRIPTION
c07ebfa1 21The command
6dbe3af9 22.B kill
83098262
BS
23sends the specified \fIsignal\fR to the specified processes or process groups.
24If no signal is specified, the TERM signal is sent. This TERM signal will kill
25processes that do not catch it; for other processes it may be necessary to use
26the KILL signal (number 9), since this signal cannot be caught.
c07ebfa1 27.PP
9e068ce0 28Most modern shells have a builtin kill function, with a usage rather similar to
83098262
BS
29that of the command described here. The
30.BR \-\-all ,
31.BR \-\-pid ", and"
32.BR \-\-queue
33options, and the possibility to specify processes by command name, are local extensions.
bd0fb63d 34.PP
83098262
BS
35If \fIsignal\fR is 0, then no actual signal is sent, but error checking is still performed.
36
37.SH ARGUMENTS
38The list of processes to be signaled can be a mixture of names and pids.
6dbe3af9 39.TP
83098262
BS
40.I pid
41Each
6dbe3af9 42.I pid
10ab72e7 43can be one of four things:
c07ebfa1
KZ
44.RS
45.TP
fd6b7a7f
KZ
46.I n
47where
48.I n
49is larger than 0. The process with pid
50.I n
83098262 51is signaled.
c07ebfa1
KZ
52.TP
53.B 0
54All processes in the current process group are signaled.
55.TP
56.B -1
83098262 57All processes with a pid larger than 1 are signaled.
c07ebfa1
KZ
58.TP
59.BI - n
b0315e1f
PB
60where
61.I n
9e068ce0 62is larger than 1. All processes in process group
fd6b7a7f 63.I n
9e068ce0 64are signaled. When an argument of the form '-n' is given, and it is meant to
83098262 65denote a process group, either a signal must be specified first, or the
9e068ce0
SK
66argument must be preceded by a '--' option, otherwise it will be taken as the
67signal to send.
10ab72e7 68.RE
c07ebfa1 69.TP
10ab72e7 70.I name
83098262
BS
71All processes invoked using this \fIname\fR will be signaled.
72
73.SH OPTIONS
6dbe3af9 74.TP
9e068ce0 75\fB\-s\fR, \fB\-\-signal\fR \fIsignal\fR
83098262 76The signal to send. It may be given as a name or a number.
6dbe3af9 77.TP
83098262
BS
78\fB\-l\fR, \fB\-\-list\fR [\fInumber\fR]
79Print a list of signal names, or convert the given signal number to a name.
80The signals can be found in
9e068ce0 81.I /usr/\:include/\:linux/\:signal.h
c07ebfa1 82.TP
fda84b66 83\fB\-L\fR, \fB\-\-table\fR
83098262 84Similar to \fB\-l\fR, but it will print signal names and their corresponding
fda84b66
SK
85numbers.
86.TP
9e068ce0 87\fB\-a\fR, \fB\-\-all\fR
d35df4db 88Do not restrict the command-name-to-pid conversion to processes with the same
9e068ce0 89uid as the present process.
c07ebfa1 90.TP
9e068ce0 91\fB\-p\fR, \fB\-\-pid\fR
83098262 92Only print the process id (pid) of the named processes, do not send any
9e068ce0 93signals.
a1504d8b 94.TP
1c23b1c5
RP
95\fB\-\-verbose\fR
96Print pid(s) that will be signaled with kill along with the signal.
97.TP
83098262 98\fB\-q\fR, \fB\-\-queue\fR \fIvalue\fR
a1504d8b
KZ
99Use
100.BR sigqueue (2)
101rather than
83098262
BS
102.BR kill (2).
103The
104.I value
105argument is an integer that is sent along with the signal. If the
9e068ce0
SK
106receiving process has installed a handler for this signal using the SA_SIGINFO
107flag to
a1504d8b 108.BR sigaction (2),
83098262
BS
109then it can obtain this data via the si_sigval field of the siginfo_t structure.
110
741587f3 111.SH NOTES
83098262
BS
112It is not possible to send a signal to an explicitly selected thread in a
113multithreaded process using the
741587f3 114.BR kill (2)
9e068ce0 115syscall. If
5593132a 116.BR kill (2)
83098262 117is used to send a signal to a thread group, then the kernel selects an arbitrary
9e068ce0
SK
118member of the thread group that has not blocked the signal. For more details
119see
83098262
BS
120.BR clone (2),
121the CLONE_THREAD description.
9e068ce0 122.PP
741587f3
KZ
123The command
124.BR kill (1)
125as well as syscall
126.BR kill (2)
83098262 127accept a TID (thread ID, see
741587f3 128.BR gettid (2))
83098262 129as an argument. In this case the kill behavior is not changed and the signal is
741587f3 130also delivered to the thread group rather than to the specified thread.
a01f4d43
KZ
131
132.SH RETURN CODES
133.B kill
134has the following return codes:
135.TP
136.BR 0
137success
138.TP
139.BR 1
140failure
141.TP
142.BR 64
143partial success (when more than one process specified)
144
145.SH SEE ALSO
6dbe3af9
KZ
146.BR bash (1),
147.BR tcsh (1),
c07ebfa1 148.BR sigvec (2),
f053ff1e 149.BR kill (2),
c07ebfa1 150.BR signal (7)
6853d664
KZ
151
152.SH AUTHORS
9e068ce0
SK
153.MT svalente@mit.edu
154Salvatore Valente
6853d664
KZ
155.ME
156.br
157.MT kzak@redhat.com
158Karel Zak
159.ME
160.br
161.PP
162The original version was taken from BSD 4.4.
163
86d62711 164.SH AVAILABILITY
601d12fb 165The kill command is part of the util-linux package and is available from
9e068ce0
SK
166.UR ftp://\:ftp.kernel.org\:/pub\:/linux\:/utils\:/util-linux/
167Linux Kernel Archive
168.UE .