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