| PKILL(1) | General Commands Manual | PKILL(1) |
pgrep, pkill
— find or signal processes by name
pgrep |
[-flnoqvx] [-d
delim] [-G
gid] [-g
pgrp] [-P
ppid] [-s
sid] [-T
rtable] [-t
tty] [-U
uid] [-u
euid] [pattern ...] |
pkill |
[-signal]
[-fIlnoqvx] [-G
gid] [-g
pgrp] [-P
ppid] [-s
sid] [-T
rtable] [-t
tty] [-U
uid] [-u
euid] [pattern ...] |
The 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.
The pkill command searches the process
table on the running system and signals all processes that match the
criteria given on the command line.
The following options are available:
-d
delimpgrep command.-f-G
gid-g
pgrppgrep
or pkill command.-I-l-f,
print the process ID and the full argument list for each matching process
(pgrep only).-n-o.-o-n.-P
ppid-q-q takes precedence over other
display options such as -l.-s
sidpgrep or
pkill command.-T
rtable-t
tty-U
uid-u
euid-v-x-f is given. The default is to match any
substring.-signalpkill.If any pattern operands are specified, they
are used as extended regular expressions to match the command name. Only the
first 16 characters of the command name are matched; attempts to match any
characters after the first 16 will silently fail. If
-f is specified, the full argument list, including
the full command name, of each process is matched.
Note that a running pgrep or
pkill process will never consider itself or system
processes (kernel threads) as a potential match.
The pgrep and
pkill utilities exit with one of the following
values:
grep(1), kill(1), ps(1), kill(2), sigaction(2), re_format(7)
pkill and pgrep
first appeared in OpenBSD 3.5. They are modelled
after utilities of the same name that appeared in Sun Solaris 7.
Andrew Doran <ad@NetBSD.org>.
| November 14, 2020 | openbsd |