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