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