OnCallReady

Commands

pgrep - list process IDs matching a pattern

pgrep [-f] [-u user] [-l] [-a] [-o] [-n] PATTERN

Options you will use

-l
List the process name as well as the PID.
-a
List the full command line.
-f
Match the full command line.
-o, -n
Only the oldest / newest matching process.
-x, --exact
Match the whole process name exactly (pgrep -x sshd does not match sshd-session).
-f, --full
Match against the full command line, not just the name.
-o, --oldest
Only the oldest matching process.
-n, --newest
Only the newest matching process.
-u, --euid USER
Only processes of this user.
-l, --list-name
Print the name next to the PID.

Examples

$ pgrep -o sshd

the parent sshd - useful for oom_score_adj

Try pgrep in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.