Name

pidof

Synopsis

pidof [options] programs

Display the process IDs of the listed program or programs. pidof is actually a symbolic link to killall5.

Options

-c

Return only processes running in the same root directory. Ignored for nonroot users.

-o pid

Omit all processes with the specified process ID. Can be specified more than once to omit multiple IDs.

-s

Return a single process ID.

-x

Also return process IDs of shells running the named scripts.

Get Linux in a Nutshell, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.