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 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 z 42.Op Fl j Ar jid 43.Op Fl u Ar user 44.Op Fl t Ar tty 45.Op Fl c Ar procname 46.Op Fl SIGNAL 47.Op Ar procname ... 48.Sh DESCRIPTION 49The 50.Nm 51utility kills processes selected by name, as opposed to the selection by pid 52as done by 53.Xr kill 1 . 54By default, it will send a 55.Dv TERM 56signal to all processes with a real UID identical to the 57caller of 58.Nm 59that match the name 60.Ar procname . 61The super-user is allowed to kill any process. 62.Pp 63The options are as follows: 64.Bl -tag -width 10n -offset indent 65.It Fl d | v 66Be more verbose about what will be done. For a single 67.Fl d 68option, a list of the processes that will be sent the signal will be 69printed, or a message indicating that no matching processes have been 70found. 71.It Fl h | ?\& 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 insensitive) regular expression against the names 81of processes found. 82CAUTION! This is dangerous, a single dot will match any process 83running under the real UID of the caller. 84.It Fl s 85Show only what would be done, but do not send any signal. 86.It Fl SIGNAL 87Send a different signal instead of the default 88.Dv TERM . 89The signal may be specified either as a name 90(with or without a leading 91.Dv SIG ) , 92or numerically. 93.It Fl j Ar jid 94Kill processes in the jail specified by 95.Ar jid . 96.It Fl u Ar user 97Limit potentially matching processes to those belonging to 98the specified 99.Ar user . 100.It Fl t Ar tty 101Limit potentially matching processes to those running on 102the specified 103.Ar tty . 104.It Fl c Ar procname 105When used with the 106.Fl u 107or 108.Fl t 109flags, limit potentially matching processes to those matching 110the specified 111.Ar procname . 112.It Fl z 113Do not skip zombies. 114This should not have any effect except to print a few error messages 115if there are zombie processes that match the specified pattern. 116.El 117.Sh ALL PROCESSES 118Sending a signal to all processes with uid 119.Em XYZ 120is already supported by 121.Xr kill 1 . 122So use 123.Xr kill 1 124for this job (e.g. $ kill -TERM -1 or 125as root $ echo kill -TERM -1 | su -m <user>) 126.Sh DIAGNOSTICS 127The 128.Nm 129command will respond with a short usage message and exit with a status 130of 2 in case of a command error. A status of 1 will be returned if 131either no matching process has been found or not all processes have 132been signalled successfully. Otherwise, a status of 0 will be 133returned. 134.Pp 135Diagnostic messages will only be printed if requested by 136.Fl d 137options. 138.Sh SEE ALSO 139.Xr kill 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