.TH PIDOF 8 "01 Sep 1998" "" "Linux System Administrator's Manual"
pidof -- find the process ID of a running program.
.RB [ \-s ]
.RB [ \-x ]
.RB [ \-o
.IR omitpid ]
.RB [ \-o
.IR omitpid.. ]
.RB [ program.. ]
finds the process id's (pids) of the named programs. It prints those
id's on the standard output. This program is on some systems used in
run-level change scripts, especially when the system has a
\fISystem-V\fP like \fIrc\fP structure. In that case these scripts are
located in /etc/rc?.d, where ? is the runlevel. If the system has
(8) program that should be used instead.
Single shot - this instructs the program to only return one \fIpid\fP.
Scripts too - this causes the program to also return process id's of
shells running the named scripts.
.IP -o \fIomitpid\fP
Tells \fIpidof\fP to omit processes with that process id. The special
pid \fB%PPID\fP can be used to name the parent process of the \fIpidof\fP
program, in other words the calling shell or shell script.
\fIpidof\fP is simply a (symbolic) link to the \fIkillall5\fP program,
which should also be located in \fP/sbin\fP.
When \fIpidof\fP is invoked with a full pathname to the program it
should find the pid of, it is reasonably safe. Otherwise it is possible
that it returns pids of running programs that happen to have the same name
as the program you're after but are actually other programs.
.SH SEE ALSO
.BR shutdown (8),
.BR init (8),
.BR halt (8),
.BR reboot (8)
Miquel van Smoorenburg, email@example.com