>_ IzzyLab

Topic breakdown

Every process has a numeric identifier (PID), and you often need to find it not by eye in ps, but programmatically — by name or by launch string. The pgrep utility does exactly that: it prints the PIDs of matching processes. By default it only matches the executable's name, while the -f flag extends the match to the whole command line with arguments — this lets you distinguish a specific instance (with a particular argument) from other processes with the same name.

What's checked

  1. PID of process sleep 12345 written

What it looks like