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