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