pidof

Name

pidof -- find the process ID of a running program

Synopsis

pidof [-s] [-x] [-o omitpid..] program [program..]

Description

Return the process ID of a process which is running the program named on the command line.[1]

Options

-s

instructs the program to only return one pid.

-x

causes the program to also return process id's of shells running the named scripts.

-o

omits processes with specified process id.

Notes

[1]

Need further investigation on the behavior of various implementations concerning whether program is a full pathname, the basename only, the program as named by argv[0], or what.