Annotation of src/usr.bin/pkill/pkill.1, Revision 1.22
1.22 ! wiz 1: .\" $NetBSD: pkill.1,v 1.21 2010/12/07 07:39:15 mrg Exp $
1.1 ad 2: .\"
3: .\" Copyright (c) 2002 The NetBSD Foundation, Inc.
4: .\" All rights reserved.
5: .\"
6: .\" This code is derived from software contributed to The NetBSD Foundation
7: .\" by Andrew Doran.
8: .\"
9: .\" Redistribution and use in source and binary forms, with or without
10: .\" modification, are permitted provided that the following conditions
11: .\" are met:
12: .\" 1. Redistributions of source code must retain the above copyright
13: .\" notice, this list of conditions and the following disclaimer.
14: .\" 2. Redistributions in binary form must reproduce the above copyright
15: .\" notice, this list of conditions and the following disclaimer in the
16: .\" documentation and/or other materials provided with the distribution.
17: .\"
18: .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19: .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20: .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21: .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22: .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23: .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24: .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25: .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26: .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27: .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28: .\" POSSIBILITY OF SUCH DAMAGE.
29: .\"
1.22 ! wiz 30: .Dd December 7, 2010
1.1 ad 31: .Dt PKILL 1
32: .Os
33: .Sh NAME
34: .Nm pkill
35: .Nd find or signal processes by name
36: .Sh SYNOPSIS
37: .Nm pgrep
1.9 sketch 38: .Op Fl filnvx
1.11 wiz 39: .Op Fl d Ar delim
1.1 ad 40: .Op Fl G Ar gid
1.11 wiz 41: .Op Fl g Ar pgrp
1.1 ad 42: .Op Fl P Ar ppid
43: .Op Fl s Ar sid
44: .Op Fl t Ar tty
1.11 wiz 45: .Op Fl U Ar uid
1.1 ad 46: .Op Fl u Ar euid
1.11 wiz 47: .Op Ar pattern ...
1.1 ad 48: .Nm pkill
49: .Op Fl signal
1.9 sketch 50: .Op Fl finvx
1.1 ad 51: .Op Fl G Ar gid
1.11 wiz 52: .Op Fl g Ar pgrp
1.1 ad 53: .Op Fl P Ar ppid
54: .Op Fl s Ar sid
55: .Op Fl t Ar tty
1.11 wiz 56: .Op Fl U Ar uid
1.1 ad 57: .Op Fl u Ar euid
1.11 wiz 58: .Op Ar pattern ...
1.19 mrg 59: .Nm prenice
1.21 mrg 60: .Op Fl l
1.19 mrg 61: .Op Ar priority
62: .Op Ar pattern ...
1.1 ad 63: .Sh DESCRIPTION
64: The
65: .Nm pgrep
66: command searches the process table on the running system and prints the
67: process IDs of all processes that match the criteria given on the command
68: line.
69: .Pp
70: The
71: .Nm pkill
72: command searches the process table on the running system and signals all
73: processes that match the criteria given on the command line.
74: .Pp
1.19 mrg 75: The
76: .Nm prenice
77: command searches the process table on the running system and sets the
78: priority of all processes that match the criteria given on the command line.
79: .Pp
80: The following options are available for
81: .Nm pkill
82: and
1.22 ! wiz 83: .Nm pgrep :
1.3 ad 84: .Bl -tag -width xxxxxxxx
1.1 ad 85: .It Fl d Ar delim
86: Specify a delimiter to be printed between each process ID.
87: The default is a newline.
88: This option can only be used with the
89: .Nm pgrep
90: command.
91: .It Fl f
92: Match against full argument lists.
93: The default is to match against process names.
1.11 wiz 94: .It Fl G Ar gid
95: Restrict matches to processes with a real group ID in the comma-separated
96: list
97: .Ar gid .
1.1 ad 98: .It Fl g Ar pgrp
1.2 wiz 99: Restrict matches to processes with a process group ID in the comma-separated
1.1 ad 100: list
101: .Ar pgrp .
102: The value zero is taken to mean the process group ID of the running
103: .Nm pgrep
104: or
105: .Nm pkill
106: command.
1.9 sketch 107: .It Fl i
108: Ignore case distinctions in both the process table and the supplied pattern.
1.1 ad 109: .It Fl l
110: Long output.
111: Print the process name in addition to the process ID for each matching
112: process.
113: If used in conjunction with
114: .Fl f ,
115: print the process ID and the full argument list for each matching process.
116: .It Fl n
117: Match only the most recently created process, if any.
1.11 wiz 118: .It Fl P Ar ppid
119: Restrict matches to processes with a parent process ID in the
120: comma-separated list
121: .Ar ppid .
1.1 ad 122: .It Fl s Ar sid
1.2 wiz 123: Restrict matches to processes with a session ID in the comma-separated
1.1 ad 124: list
125: .Ar sid .
126: The value zero is taken to mean the session ID of the running
127: .Nm pgrep
128: or
129: .Nm pkill
130: command.
131: .It Fl t Ar tty
132: Restrict matches to processes associated with a terminal in the
1.2 wiz 133: comma-separated list
1.1 ad 134: .Ar tty .
1.17 christos 135: Terminal names may be specified as a fully qualified path, in the form
136: .Sq ttyXX ,
137: or
138: .Sq pts/N ,
139: (where
1.18 wiz 140: .Ar XX
141: is any pair of letters, and
1.17 christos 142: .Ar N
143: is a number),
1.18 wiz 144: or the shortened forms
145: .Sq XX
146: or
1.17 christos 147: .Sq N .
1.12 wiz 148: A single dash
149: .Pq Sq -
150: matches processes not associated with a terminal.
1.11 wiz 151: .It Fl U Ar uid
152: Restrict matches to processes with a real user ID in the comma-separated
153: list
154: .Ar uid .
1.1 ad 155: .It Fl u Ar euid
156: Restrict matches to processes with an effective user ID in the
1.2 wiz 157: comma-separated list
1.1 ad 158: .Ar euid .
159: .It Fl v
160: Reverse the sense of the matching; display processes that do not match the
161: given criteria.
162: .It Fl x
1.2 wiz 163: Require an exact match of the process name, or argument list if
164: .Fl f
165: is given.
1.1 ad 166: The default is to match any substring.
167: .It Fl signal
168: A non-negative decimal number or symbolic signal name specifying the signal
169: to be sent instead of the default TERM.
170: This option is valid only when given as the first argument to
171: .Nm pkill .
172: .El
173: .Pp
1.22 ! wiz 174: The
! 175: .Fl l
! 176: flag is also availale for
! 177: .Nm prenice .
! 178: .Pp
1.1 ad 179: Note that a running
180: .Nm pgrep
181: or
182: .Nm pkill
1.12 wiz 183: process will never consider itself or system processes (kernel threads) as
1.7 ad 184: a potential match.
1.1 ad 185: .Sh EXIT STATUS
1.19 mrg 186: .Nm pgrep ,
1.20 wiz 187: .Nm pkill ,
1.1 ad 188: and
1.19 mrg 189: .Nm prenice
1.1 ad 190: return one of the following values upon exit:
191: .Bl -tag -width foo
192: .It 0
193: One or more processes were matched.
194: .It 1
195: No processes were matched.
196: .It 2
197: Invalid options were specified on the command line.
198: .It 3
199: An internal error occurred.
200: .El
201: .Sh SEE ALSO
1.13 jmmv 202: .Xr grep 1 ,
1.1 ad 203: .Xr kill 1 ,
204: .Xr ps 1 ,
205: .Xr kill 2 ,
206: .Xr sigaction 2 ,
207: .Xr re_format 7 ,
1.20 wiz 208: .Xr signal 7 ,
209: .Xr renice 8
1.4 jdolecek 210: .Sh HISTORY
211: .Nm pkill
212: and
213: .Nm pgrep
1.5 ad 214: first appeared in
1.4 jdolecek 215: .Nx 1.6 .
1.5 ad 216: They are modelled after utilities of the same name that appeared in Sun
1.6 ad 217: Solaris 7.
1.19 mrg 218: .Pp
219: .Nm prenice
220: was introduced in
221: .Nx 6.0 .
CVSweb <webmaster@jp.NetBSD.org>