$ pgrep
Look up processes based on name and other attributes
DOCUMENTEDProcessesUbuntu 24.04 LTS baseline
Synopsis
pgrep [options] pattern
What it does
- `pgrep` selects processes based on attributes and prints their process IDs by default.
- The exact matching rules and available selectors are documented in its manual.
Examples
Find processes whose name matches
pgrep nginxShow process IDs and names
pgrep -a nginxImportant details
These examples are intentionally conservative. Command behavior can still depend on filesystem state, permissions, locale, shell, installed package version, and other system configuration.
For exact option semantics, the linked authoritative documentation is the source of truth.