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