]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/killall/killall.1
ident(1): Normalizing date format
[FreeBSD/FreeBSD.git] / usr.bin / killall / killall.1
1 .\" Copyright (C) 1995 by Joerg Wunsch, Dresden
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS
14 .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16 .\" DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT,
17 .\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18 .\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 .\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
21 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22 .\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
23 .\" POSSIBILITY OF SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .Dd June 27, 2020
28 .Dt KILLALL 1
29 .Os
30 .Sh NAME
31 .Nm killall
32 .Nd kill processes by name
33 .Sh SYNOPSIS
34 .Nm
35 .Op Fl delmsvz
36 .Op Fl help
37 .Op Fl I
38 .Op Fl j Ar jail
39 .Op Fl u Ar user
40 .Op Fl t Ar tty
41 .Op Fl c Ar procname
42 .Op Fl Ar SIGNAL
43 .Op Ar procname ...
44 .Sh DESCRIPTION
45 The
46 .Nm
47 utility kills processes selected by name, as opposed to the selection by PID
48 as done by
49 .Xr kill 1 .
50 By default, it will send a
51 .Dv TERM
52 signal to all processes with a real UID identical to the
53 caller of
54 .Nm
55 that match the name
56 .Ar procname .
57 The super-user is allowed to kill any process.
58 .Pp
59 The options are as follows:
60 .Bl -tag -width ".Fl c Ar procname"
61 .It Fl d
62 Be more verbose about what will be done, but do not send any signal.
63 The total number of user processes and the real user ID is shown.
64 A list of the processes that will be sent the signal will be printed, or a
65 message indicating that no matching processes have been found.
66 .It Fl e
67 Use the effective user ID instead of the (default) real user ID for matching
68 processes specified with the
69 .Fl u
70 option.
71 .It Fl help
72 Give a help on the command usage and exit.
73 .It Fl I
74 Request confirmation before attempting to signal each
75 process.
76 .It Fl l
77 List the names of the available signals and exit, like in
78 .Xr kill 1 .
79 .It Fl m
80 Match the argument
81 .Ar procname
82 as a (case sensitive) regular expression against the names
83 of processes found.
84 CAUTION!
85 This is dangerous, a single dot will match any process
86 running under the real UID of the caller.
87 .It Fl v
88 Be verbose about what will be done.
89 .It Fl s
90 Same as
91 .Fl v ,
92 but do not send any signal.
93 .It Fl Ar SIGNAL
94 Send a different signal instead of the default
95 .Dv TERM .
96 The signal may be specified either as a name
97 (with or without a leading
98 .Dq Li SIG ) ,
99 or numerically.
100 .It Fl j Ar jail
101 Kill processes in the specified
102 .Ar jail .
103 .It Fl u Ar user
104 Limit potentially matching processes to those belonging to
105 the specified
106 .Ar user .
107 .It Fl t Ar tty
108 Limit potentially matching processes to those running on
109 the specified
110 .Ar tty .
111 .It Fl c Ar procname
112 Limit potentially matching processes to those matching
113 the specified
114 .Ar procname .
115 .It Fl q
116 Suppress error message if no processes are matched.
117 .It Fl z
118 Do not skip zombies.
119 This should not have any effect except to print a few error messages
120 if there are zombie processes that match the specified pattern.
121 .El
122 .Sh ALL PROCESSES
123 Sending a signal to all processes with the given UID
124 is already supported by
125 .Xr kill 1 .
126 So use
127 .Xr kill 1
128 for this job (e.g.\&
129 .Dq Li "kill -TERM -1"
130 or as root
131 .Dq Li "echo kill -TERM -1 | su -m <user>" ) .
132 .Sh IMPLEMENTATION NOTES
133 This
134 .Fx
135 implementation of
136 .Nm
137 has completely different semantics as compared to the traditional
138 .Ux
139 System V behavior of
140 .Nm .
141 The latter will kill all processes that the current user is able to
142 kill, and is intended to be used by the system shutdown process only.
143 .Sh EXIT STATUS
144 The
145 .Nm
146 utility exits 0 if some processes have been found and
147 signalled successfully.
148 Otherwise, a status of 1 will be
149 returned.
150 .Sh EXAMPLES
151 Send
152 .Dv SIGTERM
153 to all firefox processes:
154 .Bd -literal -offset indent
155 killall firefox
156 .Ed
157 .Pp
158 Send
159 .Dv SIGTERM
160 to firefox processes belonging to
161 .Va USER :
162 .Bd -literal -offset indent
163 killall -u ${USER} firefox
164 .Ed
165 .Pp
166 Stop all firefox processes:
167 .Bd -literal -offset indent
168 killall -SIGSTOP firefox
169 .Ed
170 .Pp
171 Resume firefox processes:
172 .Bd -literal -offset indent
173 killall -SIGCONT firefox
174 .Ed
175 .Pp
176 Show what would be done to firefox processes, but do not actually signal them:
177 .Bd -literal -offset indent
178 killall -s firefox
179 .Ed
180 .Pp
181 Send
182 .Dv SIGKILL
183 to csh process running inside jail ID 282:
184 .Bd -literal -offset indent
185 killall -9 -j282 csh
186 .Ed
187 .Pp
188 Send
189 .Dv SIGTERM
190 to all processes matching provided pattern (like vim and vimdiff):
191 .Bd -literal -offset indent
192 killall -m 'vim*'
193 .Ed
194 .Sh DIAGNOSTICS
195 Diagnostic messages will only be printed if the
196 .Fl d
197 flag is used.
198 .Sh SEE ALSO
199 .Xr kill 1 ,
200 .Xr pkill 1 ,
201 .Xr sysctl 3 ,
202 .Xr jail 8
203 .Sh HISTORY
204 The
205 .Nm
206 command appeared in
207 .Fx 2.1 .
208 It has been modeled after the
209 .Nm
210 command as available on other platforms.
211 .Sh AUTHORS
212 .An -nosplit
213 The
214 .Nm
215 program was originally written in Perl and was contributed by
216 .An Wolfram Schneider ,
217 this manual page has been written by
218 .An J\(:org Wunsch .
219 The current version of
220 .Nm
221 was rewritten in C by
222 .An Peter Wemm
223 using
224 .Xr sysctl 3 .