diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-25 19:55:15 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-25 19:55:15 -0400 |
| commit | 253e67c8b3a72b3a4757fdbc5845297628db0a4a (patch) | |
| tree | adf53b66087aa30dfbf8bf391a1dadb044c3bf4d /static/netbsd/man1/pkill.1 | |
| parent | a9157ce950dfe2fc30795d43b9d79b9d1bffc48b (diff) | |
docs: Added All NetBSD Manuals
Diffstat (limited to 'static/netbsd/man1/pkill.1')
| -rw-r--r-- | static/netbsd/man1/pkill.1 | 261 |
1 files changed, 261 insertions, 0 deletions
diff --git a/static/netbsd/man1/pkill.1 b/static/netbsd/man1/pkill.1 new file mode 100644 index 00000000..56a11963 --- /dev/null +++ b/static/netbsd/man1/pkill.1 @@ -0,0 +1,261 @@ +.\" $NetBSD: pkill.1,v 1.33 2024/10/07 06:14:05 roy 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. +.\" +.\" 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 October 6, 2024 +.Dt PKILL 1 +.Os +.Sh NAME +.Nm pkill , +.Nm pgrep , +.Nm prenice +.Nd find or signal processes by name +.Sh SYNOPSIS +.Nm pgrep +.Op Fl fiLlnqvx +.Op Fl d Ar delim +.Op Fl F Ar pidfile +.Op Fl G Ar gid +.Op Fl g Ar pgrp +.Op Fl P Ar ppid +.Op Fl s Ar sid +.Op Fl t Ar tty +.Op Fl U Ar uid +.Op Fl u Ar euid +.Ar pattern ... +.Nm pkill +.Op Fl signal +.Op Fl fiLlnvx +.Op Fl F Ar pidfile +.Op Fl G Ar gid +.Op Fl g Ar pgrp +.Op Fl P Ar ppid +.Op Fl s Ar sid +.Op Fl t Ar tty +.Op Fl U Ar uid +.Op Fl u Ar euid +.Ar pattern ... +.Nm prenice +.Op Fl l +.Ar priority +.Ar pattern ... +.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 +.Nm prenice +command searches the process table on the running system and sets the +priority of all processes that match the criteria given on the command line. +.Pp +By default, matching applies to any substring of the command name +.Pq Va argv[0] , +but options may be used to change this. +Patterns are specified using extended regular expressions (see +.Xr re_format 7 ) . +.Pp +The following options are available for +.Nm pkill +and +.Nm pgrep : +.Bl -tag -width ".Fl F Ar pidfile" +.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 F Ar pidfile +Restrict matches to processes which pid is stored in +.Ar pidfile +file. +.It Fl G Ar gid +Restrict matches to processes with a real group ID in the comma-separated +list +.Ar gid . +.It Fl g Ar pgrp +Restrict matches to processes with a process group ID in the comma-separated +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 i +Ignore case distinctions in both the process table and the supplied pattern. +.It Fl L +The +.Ar pidfile +given for the +.Fl F +option must be locked with the +.Xr flock 2 +syscall or created with +.Xr pidfile_lock 3 . +.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. +.It Fl n +Match only the most recently created process, if any. +.It Fl P Ar ppid +Restrict matches to processes with a parent process ID in the +comma-separated list +.Ar ppid . +.It Fl s Ar sid +Restrict matches to processes with a session ID in the comma-separated +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-separated list +.Ar tty . +Terminal names may be specified as a fully qualified path, in the form +.Sq ttyXX , +or +.Sq pts/N , +(where +.Ar XX +is any pair of letters, and +.Ar N +is a number), +or the shortened forms +.Sq XX +or +.Sq N . +A single dash +.Pq Sq - +matches processes not associated with a terminal. +.It Fl U Ar uid +Restrict matches to processes with a real user ID in the comma-separated +list +.Ar uid . +.It Fl u Ar euid +Restrict matches to processes with an effective user ID in the +comma-separated 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 +.Fl 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 +The following option is also available for +.Nm pgrep : +.Bl -tag -width ".Fl F Ar pidfile" +.It Fl q +Quiet; do not write anything to standard output. +.El +.Pp +The +.Fl l +flag is also available for +.Nm prenice . +.Pp +Note that a running +.Nm pgrep , +.Nm pkill , +or +.Nm prenice +process will never consider itself or system processes (kernel threads) as +a potential match. +.Sh IMPLEMENTATION NOTES +The Sun Solaris implementation utilised procfs to obtain process information. +This implementation utilises +.Xr kvm 3 +instead. +.Sh EXIT STATUS +.Nm pgrep , +.Nm pkill , +and +.Nm prenice +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 grep 1 , +.Xr kill 1 , +.Xr ps 1 , +.Xr kill 2 , +.Xr sigaction 2 , +.Xr kvm 3 , +.Xr re_format 7 , +.Xr signal 7 , +.Xr renice 8 +.Sh HISTORY +.Nm pkill +and +.Nm pgrep +first appeared in +.Nx 1.6 . +They are modelled after utilities of the same name that appeared in Sun +Solaris 7. +.Pp +.Nm prenice +was introduced in +.Nx 6.0 . +.Sh AUTHORS +.An Andrew Doran +.Aq Mt ad@NetBSD.org . |
