[BACK]Return to pkill.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / pkill

Annotation of src/usr.bin/pkill/pkill.1, Revision 1.5

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