# info > pkill

---
type: CommandReference
command: pgrep
mode: man
section: 1
source: man-pages
---

## Quick Reference

- `pgrep pattern` — find PIDs of processes matching pattern
- `pkill pattern` — signal processes matching pattern (default SIGTERM)
- `pidwait pattern` — wait for processes matching pattern
- `pgrep -u root sshd` — find PIDs of sshd owned by root
- `pkill -HUP syslogd` — make syslog reread config
- `pgrep -f "pattern"` — match against full command line
- `pgrep -x pattern` — exact match of process name
- `pgrep -l` — list process name and PID

## Name

pgrep, pkill, pidwait — look up, signal, or wait for processes based on name and other attributes

## Synopsis

`pgrep [options] pattern`
`pkill [options] pattern`
`pidwait [options] pattern`

## Options

### Signal
- `-signal, --signal signal` — define signal to send (pkill only)

### Output Control
- `-c, --count` — print count of matching processes (suppress normal output)
- `-d, --delimiter delimiter` — delimiter between PIDs (default newline; pgrep only)
- `-e, --echo` — display name and PID of killed process (pkill only)
- `-l, --list-name` — list process name and PID (pgrep only)
- `-a, --list-full` — list full command line and PID (pgrep only)

### Matching
- `-f, --full` — match pattern against full command line
- `-g, --pgroup pgrp,...` — match processes in given process group IDs (0 = own)
- `-G, --group gid,...` — match processes with real group ID
- `-i, --ignore-case` — case-insensitive matching
- `-n, --newest` — select most recently started process
- `-o, --oldest` — select least recently started process
- `-O, --older secs` — select processes older than secs
- `-P, --parent ppid,...` — match processes with given parent PID
- `-s, --session sid,...` — match processes with given session ID (0 = own)
- `-t, --terminal term,...` — match processes with given controlling terminal (without /dev/)
- `-u, --euid euid,...` — match processes with effective user ID
- `-U, --uid uid,...` — match processes with real user ID
- `-v, --inverse` — negate matching (disabled in pkill short option)
- `-w, --lightweight` — show thread IDs instead of PIDs (pgrep/pidwait only)
- `-x, --exact` — match exactly (process name or full command with -f)
- `-F, --pidfile file` — read PIDs from file
- `-L, --logpidfile` — fail if pidfile not locked
- `-r, --runstates D,R,S,Z,...` — match processes by state
- `--ns pid` — match processes in same namespaces as pid (requires root for other users)
- `--nslist name,...` — limit namespaces to match (ipc, mnt, net, pid, user, uts)
- `-q, --queue value` — use sigqueue with integer value

### Other
- `-V, --version` — display version
- `-h, --help` — display help

## Examples

shell
# Find PID of named daemon as root
$ pgrep -u root named

# Make syslog reread config
$ pkill -HUP syslogd

# List all xterm processes with full details
$ ps -fp $(pgrep -d, -x xterm)

# Reduce priority of all chrome processes
$ renice +4 $(pgrep chrome)
## See Also

[ps(1)](http://localhost/phpMan.php/man/ps/1/markdown), [regex(7)](http://localhost/phpMan.php/man/regex/7/markdown), [signal(7)](http://localhost/phpMan.php/man/signal/7/markdown), [sigqueue(3)](http://localhost/phpMan.php/man/sigqueue/3/markdown), [killall(1)](http://localhost/phpMan.php/man/killall/1/markdown), [skill(1)](http://localhost/phpMan.php/man/skill/1/markdown), [kill(1)](http://localhost/phpMan.php/man/kill/1/markdown), [kill(2)](http://localhost/phpMan.php/man/kill/2/markdown)

## Exit Codes

- `0` — one or more processes matched (and successfully signaled/wait for pkill/pidwait)
- `1` — no processes matched or none could be signaled
- `2` — syntax error
- `3` — fatal error (out of memory, etc.)

Note: The process name used for matching is limited to 15 characters from /proc/pid/stat. Use `-f` to match against full command line. The running pgrep/pkill/pidwait never reports itself as a match. Options `-n`, `-o`, and `-v` cannot be combined. Defunct processes are reported.