]> git.ipfire.org Git - thirdparty/util-linux.git/blame - misc-utils/kill.1
tests: logger with socat device
[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
SK
87\fB\-a\fR, \fB\-\-all\fR
88Do not restrict the commandname-to-pid conversion to processes with the same
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.
c5b057b3 94.IP
83098262
BS
95The \fB\-\-pid\fR option is automatically enabled when the \fBkill\fR command
96is invoked with the name of
c5b057b3 97.BR pid .
83098262 98This functionality is deprecated, and will be removed in March 2016.
a1504d8b 99.TP
83098262 100\fB\-q\fR, \fB\-\-queue\fR \fIvalue\fR
a1504d8b
KZ
101Use
102.BR sigqueue (2)
103rather than
83098262
BS
104.BR kill (2).
105The
106.I value
107argument is an integer that is sent along with the signal. If the
9e068ce0
SK
108receiving process has installed a handler for this signal using the SA_SIGINFO
109flag to
a1504d8b 110.BR sigaction (2),
83098262
BS
111then it can obtain this data via the si_sigval field of the siginfo_t structure.
112
741587f3 113.SH NOTES
83098262
BS
114It is not possible to send a signal to an explicitly selected thread in a
115multithreaded process using the
741587f3 116.BR kill (2)
9e068ce0 117syscall. If
741587f3 118.BR kill(2)
83098262 119is used to send a signal to a thread group, then the kernel selects an arbitrary
9e068ce0
SK
120member of the thread group that has not blocked the signal. For more details
121see
83098262
BS
122.BR clone (2),
123the CLONE_THREAD description.
9e068ce0 124.PP
741587f3
KZ
125The command
126.BR kill (1)
127as well as syscall
128.BR kill (2)
83098262 129accept a TID (thread ID, see
741587f3 130.BR gettid (2))
83098262 131as an argument. In this case the kill behavior is not changed and the signal is
741587f3 132also delivered to the thread group rather than to the specified thread.
a01f4d43
KZ
133
134.SH RETURN CODES
135.B kill
136has the following return codes:
137.TP
138.BR 0
139success
140.TP
141.BR 1
142failure
143.TP
144.BR 64
145partial success (when more than one process specified)
146
147.SH SEE ALSO
6dbe3af9
KZ
148.BR bash (1),
149.BR tcsh (1),
150.BR kill (2),
c07ebfa1
KZ
151.BR sigvec (2),
152.BR signal (7)
6853d664
KZ
153
154.SH AUTHORS
9e068ce0
SK
155.MT svalente@mit.edu
156Salvatore Valente
6853d664
KZ
157.ME
158.br
159.MT kzak@redhat.com
160Karel Zak
161.ME
162.br
163.PP
164The original version was taken from BSD 4.4.
165
86d62711 166.SH AVAILABILITY
601d12fb 167The kill command is part of the util-linux package and is available from
9e068ce0
SK
168.UR ftp://\:ftp.kernel.org\:/pub\:/linux\:/utils\:/util-linux/
169Linux Kernel Archive
170.UE .