1 .\" $NetBSD: pkill.1,v 1.8 2003/02/14 15:59:18 grant Exp $
5 .\" Copyright (c) 2002 The NetBSD Foundation, Inc.
6 .\" All rights reserved.
8 .\" This code is derived from software contributed to The NetBSD Foundation
11 .\" Redistribution and use in source and binary forms, with or without
12 .\" modification, are permitted provided that the following conditions
14 .\" 1. Redistributions of source code must retain the above copyright
15 .\" notice, this list of conditions and the following disclaimer.
16 .\" 2. Redistributions in binary form must reproduce the above copyright
17 .\" notice, this list of conditions and the following disclaimer in the
18 .\" documentation and/or other materials provided with the distribution.
19 .\" 3. All advertising materials mentioning features or use of this software
20 .\" must display the following acknowledgement:
21 .\" This product includes software developed by the NetBSD
22 .\" Foundation, Inc. and its contributors.
23 .\" 4. Neither the name of The NetBSD Foundation nor the names of its
24 .\" contributors may be used to endorse or promote products derived
25 .\" from this software without specific prior written permission.
27 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
28 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
29 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
31 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 .\" POSSIBILITY OF SUCH DAMAGE.
44 .Nd find or signal processes by name
79 command searches the process table on the running system and prints the
80 process IDs of all processes that match the criteria given on the command
85 command searches the process table on the running system and signals all
86 processes that match the criteria given on the command line.
88 The following options are available:
89 .Bl -tag -width ".Fl F Ar pidfile"
91 Restrict matches to a process whose PID is stored in the
95 Restrict matches to processes with a real group ID in the comma-separated
99 Request confirmation before attempting to signal each process.
105 option must be locked with the
107 syscall or created with
110 Extract values associated with the name list from the specified core
111 instead of the currently running system.
113 Extract the name list from the specified system instead of the default,
114 which is the kernel image the system has booted from.
116 Restrict matches to processes with a parent process ID in the
120 Search also in system processes (kernel threads).
122 Restrict matches to processes with a real user ID in the comma-separated
126 Specify a delimiter to be printed between each process ID.
127 The default is a newline.
128 This option can only be used with the
132 Include process ancestors in the match list.
133 By default, the current
137 process and all of its ancestors are excluded (unless
141 Match against full argument lists.
142 The default is to match against process names.
144 Restrict matches to processes with a process group ID in the comma-separated
147 The value zero is taken to mean the process group ID of the running
153 Ignore case distinctions in both the process table and the supplied pattern.
155 Restrict matches to processes inside jails with a jail ID in the comma-separated
160 matches processes in any jail.
163 matches processes not in jail.
168 print the process name in addition to the process ID for each matching
170 If used in conjunction with
172 print the process ID and the full argument list for each matching process.
175 display the kill command used for each process killed.
177 Select only the newest (most recently started) of the matching processes.
179 Select only the oldest (least recently started) of the matching processes.
181 Restrict matches to processes with a session ID in the comma-separated
184 The value zero is taken to mean the session ID of the running
190 Restrict matches to processes associated with a terminal in the
193 Terminal names may be of the form
195 or the shortened form
199 matches processes not associated with a terminal.
201 Restrict matches to processes with an effective user ID in the
205 Reverse the sense of the matching; display processes that do not match the
208 Require an exact match of the process name, or argument list if
211 The default is to match any substring.
213 A non-negative decimal number or symbolic signal name specifying the signal
214 to be sent instead of the default
216 This option is valid only when given as the first argument to
222 operands are specified, they are used as regular expressions to match
223 the command name or full argument list of each process.
226 option is not specified, then the
228 will attempt to match the command name.
231 will only keep track of the first 19 characters of the command
232 name for each process.
233 Attempts to match any characters after the first 19 of a command name
240 process will never consider itself nor system processes (kernel threads) as
248 return one of the following values upon exit:
249 .Bl -tag -width indent
251 One or more processes were matched.
253 No processes were matched.
255 Invalid options were specified on the command line.
257 An internal error occurred.
260 Historically the option
262 means any jail, although in other utilities such as
266 has the opposite meaning, not in jail.
269 is deprecated, and its use is discouraged in favor of
289 They are modelled after utilities of the same name that appeared in Sun
291 They made their first appearance in