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 25, 1995 28.Os FreeBSD 29.Dt KILLALL 1 30.Sh NAME 31.Nm killall 32.Nd kill processes by name 33.Sh SYNOPSIS 34.Nm 35.Op Fl d | v 36.Op Fl h | ?\& 37.Op Fl help 38.Op Fl l 39.Op Fl m 40.Op Fl s 41.Op Fl u Ar user 42.Op Fl t Ar tty 43.Op Fl c Ar procname 44.Op Fl SIGNAL 45.Op Ar procname ... 46.Sh DESCRIPTION 47.Nm Killall 48kills processes selected by name, as opposed to the selection by pid 49as done by 50.Xr kill 1 . 51By default, it will send a 52.Dv TERM 53signal to all processes with an effective UID identical to the 54caller of 55.Nm 56that match the name 57.Ar procname . 58The super-user is allowed to kill any process. 59.Pp 60The options are as follows: 61.Bl -tag -width 10n -offset indent 62.It Fl d | v 63Be more verbose about what will be done. For a single 64.Fl d 65option, a list of the processes that will be sent the signal will be 66printed, or a message indicating that no matching processes have been 67found. 68.It Fl h | ?\& 69.It Fl help 70Give a help on the command usage and exit. 71.It Fl l 72List the names of the available signals and exit, like in 73.Xr kill 1 . 74.It Fl m 75Match the argument 76.Ar procname 77as a (case insensitive) regular expression against the names 78of processes found. 79CAUTION! This is dangerous, a single dot will match any process 80running under the effective UID of the caller. 81.It Fl s 82Show only what would be done, but do not send any signal. 83.It Fl SIGNAL 84Send a different signal instead of the default 85.Dv TERM . 86The signal may be specified either as a name 87.Pq with \&or without a leading Dv SIG , 88or numerically. 89.It Fl u Ar user 90Limit potentially matching processes to those belonging to 91the specified 92.Ar user . 93.It Fl t Ar tty 94Limit potentially matching processes to those running on 95the specified 96.Ar tty . 97.It Fl c Ar procname 98When used with the 99.Fl u 100or 101.Fl t 102flags, limit potentially matching processes to those matching 103the specified 104.Ar progname . 105.El 106.Sh ALL PROCESSES 107Sending a signal to all processes with uid 108.Nm XYZ 109is already supported by 110.Xr kill 1 . 111So use 112.Xr kill 1 113for this job (e.g. $ kill -TERM -1 or 114as root $ echo kill -TERM -1 | su -m <user>) 115.Sh DIAGNOSTICS 116The 117.Nm 118command will respond with a short usage message and exit with a status 119of 2 in case of a command error. A status of 1 will be returned if 120either no matching process has been found or not all processes have 121been signalled successfully. Otherwise, a status of 0 will be 122returned. 123.Pp 124Diagnostic messages will only be printed if requested by 125.Fl d 126options. 127.Sh SEE ALSO 128.Xr kill 1 , 129.Xr sysctl 3 130.Sh HISTORY 131The 132.Nm 133command appeared in 134.Fx 2.1 . 135It has been modeled after the 136.Nm 137command as available on other platforms. 138.Sh AUTHORS 139.An -nosplit 140The 141.Nm 142program was originally written in Perl and was contributed by 143.An Wolfram Schneider , 144this manual page has been written by 145.An J\(:org Wunsch . 146The current version of 147.Nm 148was rewritten in C by 149.An Peter Wemm 150using 151.Xr sysctl 3 . 152