Linux

pgrep

SafeFind processes by name

pgrep -f <pattern>

Gets PIDs by name/cmdline — cleaner than ps|grep and script-friendly. -l adds names.

Examples

  • pgrep -fl javaList Java PIDs

Syntax

pgrep [-f] [-u user] <pattern>

Before you run it

Read only.

Related commands

  • psProcess snapshot
  • pkillKill processes by name
  • killKill a process

The same reference, with no signal at all

Every command and flow from this site, held on your device and searchable with no connection. Free to install, no ads.

Get it free on the App Store