Linux Processes Cheat Sheet/Find process by full command line

Match against the full command line and print PID plus command.

Section: Process Inspection Basics

Find process by full command line

bash
bash
pgrep -af "python.*worker"
Explanation

Match against the full command line and print PID plus command.

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 PID by name
Return matching PIDs for a process name pattern.
OpenIn sheetbashsame section
Find PID with pidof
List the PIDs of a program by executable name.
OpenIn sheetbashsame section
Find oldest matching process
Return the oldest matching PID.
OpenIn sheetbashsame section
Find newest matching process
Return the newest matching PID.
OpenIn sheetbashsame section
List processes with BSD format
Show all processes with user, CPU, memory, and command columns.
OpenIn sheetbashsame section
List processes with full format
Show all processes with PID, PPID, start time, and command.
OpenIn sheetbashsame section