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 April 8, 2003 28.Os 29.Dt KILLALL 1 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 jid 38.Op Fl u Ar user 39.Op Fl t Ar tty 40.Op Fl c Ar procname 41.Op Fl 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 10n -offset indent 60.It Fl d | v 61Be more verbose about what will be done. For a single 62.Fl d 63option, a list of the processes that will be sent the signal will be 64printed, or a message indicating that no matching processes have been 65found. 66.It Fl e 67Use the effective user id instead of the (default) real user id for matching 68processes specified with the 69.Fl u 70option. 71.It Fl help 72Give a help on the command usage and exit. 73.It Fl l 74List the names of the available signals and exit, like in 75.Xr kill 1 . 76.It Fl m 77Match the argument 78.Ar procname 79as a (case sensitive) regular expression against the names 80of processes found. 81CAUTION! This is dangerous, a single dot will match any process 82running under the real UID of the caller. 83.It Fl s 84Show only what would be done, but do not send any signal. 85.It Fl SIGNAL 86Send a different signal instead of the default 87.Dv TERM . 88The signal may be specified either as a name 89(with or without a leading 90.Dv SIG ) , 91or numerically. 92.It Fl j Ar jid 93Kill processes in the jail specified by 94.Ar jid . 95.It Fl u Ar user 96Limit potentially matching processes to those belonging to 97the specified 98.Ar user . 99.It Fl t Ar tty 100Limit potentially matching processes to those running on 101the specified 102.Ar tty . 103.It Fl c Ar procname 104When used with the 105.Fl u 106or 107.Fl t 108flags, limit potentially matching processes to those matching 109the specified 110.Ar procname . 111.It Fl z 112Do not skip zombies. 113This should not have any effect except to print a few error messages 114if there are zombie processes that match the specified pattern. 115.El 116.Sh ALL PROCESSES 117Sending a signal to all processes with uid 118.Em XYZ 119is already supported by 120.Xr kill 1 . 121So use 122.Xr kill 1 123for this job (e.g. $ kill -TERM -1 or 124as root $ echo kill -TERM -1 | su -m <user>) 125.Sh DIAGNOSTICS 126The 127.Nm 128command will respond with a short usage message and exit with a status 129of 2 in case of a command error. A status of 1 will be returned if 130either no matching process has been found or not all processes have 131been signalled successfully. Otherwise, a status of 0 will be 132returned. 133.Pp 134Diagnostic messages will only be printed if requested by 135.Fl d 136options. 137.Sh SEE ALSO 138.Xr kill 1 , 139.Xr pkill 1 , 140.Xr sysctl 3 , 141.Xr jail 8 142.Sh HISTORY 143The 144.Nm 145command appeared in 146.Fx 2.1 . 147It has been modeled after the 148.Nm 149command as available on other platforms. 150.Sh AUTHORS 151.An -nosplit 152The 153.Nm 154program was originally written in Perl and was contributed by 155.An Wolfram Schneider , 156this manual page has been written by 157.An J\(:org Wunsch . 158The current version of 159.Nm 160was rewritten in C by 161.An Peter Wemm 162using 163.Xr sysctl 3 . 164