Processes

pgrep

Finds process IDs by pattern.

pgrep prints PIDs for processes matching names, users, command lines, or other attributes.

Syntax
pgrep [options] pattern

Arguments explained

  • Options adjust output or behavior.
  • Arguments name the files, services, hosts, or values the command should work with.

Common examples

Find SSH daemon PIDs
pgrep sshd

Prints PIDs for matching process names.

Match full command line
pgrep -af python

Shows PIDs and full command lines containing python.

pgrep Command
FieldDetails
Commandpgrep
CategoryProcesses
Primary useFinds process IDs by pattern.
Syntaxpgrep [options] pattern