diff options
| author | ad <ad@NetBSD.org> | 2002-03-01 11:21:58 +0000 |
|---|---|---|
| committer | ad <ad@NetBSD.org> | 2002-03-01 11:21:58 +0000 |
| commit | 3b8a0d4f4f61931e616005151679110a605fb3a3 (patch) | |
| tree | 109afb0665f8021c914e3adb437453870db4f89e /usr.bin/pkill/pkill.1 | |
| parent | ba6fe47ae9911c53426c9262f3d63ec052b0e78f (diff) | |
pgrep and pkill: search the process table for processes with a particular
set of characteristics, and either print or signal the matching set. Mostly
compatible with the Solaris commands of the same name.
Diffstat (limited to 'usr.bin/pkill/pkill.1')
| -rw-r--r-- | usr.bin/pkill/pkill.1 | 182 |
1 files changed, 182 insertions, 0 deletions
diff --git a/usr.bin/pkill/pkill.1 b/usr.bin/pkill/pkill.1 new file mode 100644 index 00000000000..0a73796bebb --- /dev/null +++ b/usr.bin/pkill/pkill.1 @@ -0,0 +1,182 @@ +.\" $NetBSD: pkill.1,v 1.1 2002/03/01 11:21:58 ad Exp $ +.\" +.\" Copyright (c) 2002 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Andrew Doran. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the NetBSD +.\" Foundation, Inc. and its contributors. +.\" 4. Neither the name of The NetBSD Foundation nor the names of its +.\" contributors may be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd March 1, 2002 +.Dt PKILL 1 +.Os +.Sh NAME +.Nm pkill +.Nd find or signal processes by name +.Sh SYNOPSIS +.Nm pgrep +.Op Fl flnvx +.Op Fl G Ar gid +.Op Fl P Ar ppid +.Op Fl U Ar uid +.Op Fl d Ar delim +.Op Fl g Ar pgrp +.Op Fl s Ar sid +.Op Fl t Ar tty +.Op Fl u Ar euid +.Op Ar pattern Op ... +.Nm pkill +.Op Fl signal +.Op Fl fnvx +.Op Fl G Ar gid +.Op Fl P Ar ppid +.Op Fl U Ar uid +.Op Fl g Ar pgrp +.Op Fl s Ar sid +.Op Fl t Ar tty +.Op Fl u Ar euid +.Op Ar pattern Op ... +.Sh DESCRIPTION +The +.Nm pgrep +command searches the process table on the running system and prints the +process IDs of all processes that match the criteria given on the command +line. +.Pp +The +.Nm pkill +command searches the process table on the running system and signals all +processes that match the criteria given on the command line. +.Pp +The following options are available: +.Bl -tag -width binladen +.It Fl G Ar gid +Restrict matches to processes with a real group ID in the comma-seperated +list +.Ar gid . +.It Fl P Ar ppid +Restrict matches to processes with a parent process ID in the +comma-seperated list +.Ar ppid . +.It Fl U Ar uid +Restrict matches to processes with a real user ID in the comma-seperated +list +.Ar uid . +.It Fl d Ar delim +Specify a delimiter to be printed between each process ID. +The default is a newline. +This option can only be used with the +.Nm pgrep +command. +.It Fl f +Match against full argument lists. +The default is to match against process names. +.It Fl g Ar pgrp +Restrict matches to processes with a process group ID in the comma-seperated +list +.Ar pgrp . +The value zero is taken to mean the process group ID of the running +.Nm pgrep +or +.Nm pkill +command. +.It Fl l +Long output. +Print the process name in addition to the process ID for each matching +process. +If used in conjunction with +.Fl f , +print the process ID and the full argument list for each matching process. +This option can only be used with the +.Nm pgrep +command. +.It Fl n +Match only the most recently created process, if any. +.It Fl s Ar sid +Restrict matches to processes with a session ID in the comma-seperated +list +.Ar sid . +The value zero is taken to mean the session ID of the running +.Nm pgrep +or +.Nm pkill +command. +.It Fl t Ar tty +Restrict matches to processes associated with a terminal in the +comma-seperated list +.Ar tty . +Terminal names may be of the form `ttyxx' or the shortened form `xx'. +.It Fl u Ar euid +Restrict matches to processes with an effective user ID in the +comma-seperated list +.Ar euid . +.It Fl v +Reverse the sense of the matching; display processes that do not match the +given criteria. +.It Fl x +Require an exact match of the process name, or argument list if -f is given. +The default is to match any substring. +.It Fl signal +A non-negative decimal number or symbolic signal name specifying the signal +to be sent instead of the default TERM. +This option is valid only when given as the first argument to +.Nm pkill . +.El +.Pp +Note that a running +.Nm pgrep +or +.Nm pkill +process will never consider itself a potential match. +.Sh EXIT STATUS +.Nm pgrep +and +.Nm pkill +return one of the following values upon exit: +.Bl -tag -width foo +.It 0 +One or more processes were matched. +.It 1 +No processes were matched. +.It 2 +Invalid options were specified on the command line. +.It 3 +An internal error occurred. +.El +.Sh SEE ALSO +.Xr kill 1 , +.Xr ps 1 , +.Xr kill 2 , +.Xr sigaction 2 , +.Xr re_format 7 , +.Xr signal 7 +.Sh AUTHORS +.An Andrew Doran +.Aq ad@netbsd.org . |
