Linux Command Cheat Sheet/Find process IDs by name

Search for process IDs using a pattern.

Section: Processes Jobs and Scheduling

Find process IDs by name

bash
bash
pgrep -af nginx
Explanation

Great for scripts and quick service discovery.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Processes Jobs and Scheduling
Search text with grep
Print lines matching a pattern.
OpenIn sheetbash1 tag match
Extended regex search
Use extended regular expressions with grep.
OpenIn sheetbash1 tag match
Fixed-string search
Match text literally instead of as a regex.
OpenIn sheetbash1 tag match
Fast recursive search with rg
Recursively search text quickly while respecting ignore rules.
OpenIn sheetbash1 tag match
Find files by modification time
Search for files changed recently.
OpenIn sheetbash1 tag match
Find files by name
Search recursively for files with a matching name.
OpenIn sheetbash1 tag match