xref: /freebsd/usr.bin/killall/killall.1 (revision c2965cd1854b75e6a13cb4bd6759b71adc8d2a87)
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 December 25, 2009
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 j Ar jail
38.Op Fl u Ar user
39.Op Fl t Ar tty
40.Op Fl c Ar procname
41.Op Fl Ar SIGNAL
42.Op Ar procname ...
43.Sh DESCRIPTION
44The
45.Nm
46utility kills processes selected by name, as opposed to the selection by PID
47as done by
48.Xr kill 1 .
49By default, it will send a
50.Dv TERM
51signal to all processes with a real UID identical to the
52caller of
53.Nm
54that match the name
55.Ar procname .
56The super-user is allowed to kill any process.
57.Pp
58The options are as follows:
59.Bl -tag -width ".Fl c Ar procname"
60.It Fl d | v
61Be more verbose about what will be done.
62For a single
63.Fl d
64option, a list of the processes that will be sent the signal will be
65printed, or a message indicating that no matching processes have been
66found.
67.It Fl e
68Use the effective user ID instead of the (default) real user ID for matching
69processes specified with the
70.Fl u
71option.
72.It Fl help
73Give a help on the command usage and exit.
74.It Fl l
75List the names of the available signals and exit, like in
76.Xr kill 1 .
77.It Fl m
78Match the argument
79.Ar procname
80as a (case sensitive) regular expression against the names
81of processes found.
82CAUTION!
83This is dangerous, a single dot will match any process
84running under the real UID of the caller.
85.It Fl s
86Show only what would be done, but do not send any signal.
87.It Fl Ar SIGNAL
88Send a different signal instead of the default
89.Dv TERM .
90The signal may be specified either as a name
91(with or without a leading
92.Dq Li SIG ) ,
93or numerically.
94.It Fl j Ar jail
95Kill processes in the specified
96.Ar jail .
97.It Fl u Ar user
98Limit potentially matching processes to those belonging to
99the specified
100.Ar user .
101.It Fl t Ar tty
102Limit potentially matching processes to those running on
103the specified
104.Ar tty .
105.It Fl c Ar procname
106Limit potentially matching processes to those matching
107the specified
108.Ar procname .
109.It Fl z
110Do not skip zombies.
111This should not have any effect except to print a few error messages
112if there are zombie processes that match the specified pattern.
113.El
114.Sh ALL PROCESSES
115Sending a signal to all processes with the given UID
116is already supported by
117.Xr kill 1 .
118So use
119.Xr kill 1
120for this job (e.g.\&
121.Dq Li "kill -TERM -1"
122or as root
123.Dq Li "echo kill -TERM -1 | su -m <user>" ) .
124.Sh IMPLEMENTATION NOTES
125This
126.Fx
127implementation of
128.Nm
129has completely different semantics as compared to the traditional
130.Ux
131System V behavior of
132.Nm .
133The latter will kill all processes that the current user is able to
134kill, and is intended to be used by the system shutdown process only.
135.Sh EXIT STATUS
136The
137.Nm
138utility exits 0 if some processes have been found and
139signalled successfully.
140Otherwise, a status of 1 will be
141returned.
142.Sh DIAGNOSTICS
143Diagnostic messages will only be printed if requested by
144.Fl d
145options.
146.Sh SEE ALSO
147.Xr kill 1 ,
148.Xr pkill 1 ,
149.Xr sysctl 3 ,
150.Xr jail 8
151.Sh HISTORY
152The
153.Nm
154command appeared in
155.Fx 2.1 .
156It has been modeled after the
157.Nm
158command as available on other platforms.
159.Sh AUTHORS
160.An -nosplit
161The
162.Nm
163program was originally written in Perl and was contributed by
164.An Wolfram Schneider ,
165this manual page has been written by
166.An J\(:org Wunsch .
167The current version of
168.Nm
169was rewritten in C by
170.An Peter Wemm
171using
172.Xr sysctl 3 .
173