pgrep -u user -l
== Match a pattern ==
pgrep -f shell.sh
== Display full command ==
Requires a field argument.
pgrep -f shell.sh -a
== Display PID and binary name ==
pgrep -l sshd
== Display number of processes running matching a name ==
Useful for cron jobs:
pgrep -u clients -x rdiff-backup -c