]> git.ipfire.org Git - thirdparty/util-linux.git/blob - misc-utils/kill.1
kill: tiny change in man page
[thirdparty/util-linux.git] / misc-utils / kill.1
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
4 .TH KILL 1 "March 2013" "util-linux" "User Commands"
5 .SH NAME
6 kill \- terminate a process
7 .SH SYNOPSIS
8 .B kill
9 .RB [ \-s
10 .IR signal | \fB\-p\fP ]
11 .RB [ \-q
12 .IR sigval ]
13 .RB [ \-a ]
14 .RB [ \-\- ]
15 .IR pid ...
16 .br
17 .B kill -l
18 .RI [ signal ]
19 .SH DESCRIPTION
20 The command
21 .B kill
22 sends the specified signal to the specified process or process group. If no
23 signal is specified, the TERM signal is sent. The TERM signal will kill
24 processes which do not catch this signal. For other processes, it may be
25 necessary to use the KILL (9) signal, since this signal cannot be caught.
26 .PP
27 Most modern shells have a builtin kill function, with a usage rather similar to
28 that of the command described here. The '-a' and '-p' options, and the
29 possibility to specify processes by command name are a local extension.
30 .PP
31 If sig is 0, then no signal is sent, but error checking is still performed.
32 .SH OPTIONS
33 .TP
34 .IR pid ...
35 Specify the list of processes that
36 .B kill
37 should signal. Each
38 .I pid
39 can be one of five things:
40 .RS
41 .TP
42 .I n
43 where
44 .I n
45 is larger than 0. The process with pid
46 .I n
47 will be signaled.
48 .TP
49 .B 0
50 All processes in the current process group are signaled.
51 .TP
52 .B -1
53 All processes with pid larger than 1 will be signaled.
54 .TP
55 .BI - n
56 where
57 .I n
58 is larger than 1. All processes in process group
59 .I n
60 are signaled. When an argument of the form '-n' is given, and it is meant to
61 denote a process group, either the signal must be specified first, or the
62 argument must be preceded by a '--' option, otherwise it will be taken as the
63 signal to send.
64 .TP
65 .I commandname
66 All processes invoked using that name will be signaled.
67 .RE
68 .TP
69 \fB\-s\fR, \fB\-\-signal\fR \fIsignal\fR
70 Specify the signal to send. The signal may be given as a signal name or
71 number.
72 .TP
73 \fB\-l\fR, \fB\-\-list\fR [\fIsignal\fR]
74 Print a list of signal names, or convert signal given as argument to a name.
75 The signals are found in
76 .I /usr/\:include/\:linux/\:signal.h
77 .TP
78 \fB\-L\fR, \fB\-\-table\fR
79 Similar to \-l, but will print signal names and their corresponding
80 numbers.
81 .TP
82 \fB\-a\fR, \fB\-\-all\fR
83 Do not restrict the commandname-to-pid conversion to processes with the same
84 uid as the present process.
85 .TP
86 \fB\-p\fR, \fB\-\-pid\fR
87 Specify that
88 .B kill
89 should only print the process id (pid) of the named processes, and not send any
90 signals.
91 .IP
92 The \-\-pid option functionality is also enabled when the command
93 copied or linked to name
94 .BR pid .
95 This functionality is deprecated, and will not be removed in March 2016.
96 .TP
97 \fB\-q\fR, \fB\-\-queue\fR \fIsigval\fR
98 Use
99 .BR sigqueue (2)
100 rather than
101 .BR kill (2)
102 and the
103 .I sigval
104 argument is used to specify an integer to be sent with the signal. If the
105 receiving process has installed a handler for this signal using the SA_SIGINFO
106 flag to
107 .BR sigaction (2),
108 then it can obtain this data via the si_value field of the siginfo_t structure.
109 .SH NOTES
110 It is not possible to send a signal to explicitly selected thread in a
111 multithreaded process by
112 .BR kill (2)
113 syscall. If
114 .BR kill(2)
115 is used to send a signal to a thread group, then kernel selects arbitrary
116 member of the thread group that has not blocked the signal. For more details
117 see
118 .BR clone (2)
119 CLONE_THREAD description.
120 .PP
121 The command
122 .BR kill (1)
123 as well as syscall
124 .BR kill (2)
125 accepts TID (thread ID, see
126 .BR gettid (2))
127 as argument. In this case the kill behavior is not changed and the signal is
128 also delivered to the thread group rather than to the specified thread.
129 .SH "SEE ALSO"
130 .BR bash (1),
131 .BR tcsh (1),
132 .BR kill (2),
133 .BR sigvec (2),
134 .BR signal (7)
135 .SH AUTHOR
136 Taken from BSD 4.4. The ability to translate process names to process ids was
137 added by
138 .MT svalente@mit.edu
139 Salvatore Valente
140 .ME .
141 .SH AVAILABILITY
142 The kill command is part of the util-linux package and is available from
143 .UR ftp://\:ftp.kernel.org\:/pub\:/linux\:/utils\:/util-linux/
144 Linux Kernel Archive
145 .UE .