pgrep
From NetBSD Wiki
pgrep(1) - find or signal process by name
This command is similar to pkill, only it returns the PIDs of matched processes. The source is the same as pkill.
% pgrep sshd 8577 26612 7094 9264 8797 1019 233
Processes can be signalled as with pkill by issuing:
% pgrep sshd | xargs kill
