Linux Commands Reference - Complete Linux Command Guide

Comprehensive Linux command reference with 150+ commands. Search, filter by category, and view detailed usage examples.

Share
Back to commands

pgrep

Find process IDs by pattern

Syntax

pgrep [OPTION]... PATTERN

Common Options

-fMatch full command line
-uFilter by user
-PFilter by parent PID
-lList name with PID
-aShow full command line
-nNewest process only
-oOldest process only
-cCount matching processes

Common Examples

pgrep nginx

Find nginx PIDs

pgrep -l nginx

Show PID and name

pgrep -f "python app.py"

Match full command line

pgrep -u root -l

Find all root processes

pgrep -c nginx

Count nginx processes

pgrep -a node

Show full node commands

pgrep -P 1234

Find child processes

Related Commands

Related Tools

More Code & Dev Tools