Return matching PIDs for a process name pattern.
Section: Process Inspection Basics
Find PID by name
bash
bash
pgrep nginxExplanation
Return matching PIDs for a process name pattern.
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 Process Inspection Basics
Find process by full command line
Match against the full command line and print PID plus command.
List processes with BSD format
Show all processes with user, CPU, memory, and command columns.