1 '\" -*- coding: UTF-8 -*-
2 .\" Copyright (C) 1998 Miquel van Smoorenburg.
4 .\" This program is free software; you can redistribute it and/or modify
5 .\" it under the terms of the GNU General Public License as published by
6 .\" the Free Software Foundation; either version 2 of the License, or
7 .\" (at your option) any later version.
9 .\" This program is distributed in the hope that it will be useful,
10 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
11 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 .\" GNU General Public License for more details.
14 .\" You should have received a copy of the GNU General Public License
15 .\" along with this program; if not, write to the Free Software
16 .\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 .TH PIDOF 8 "01 Sep 1998" "" "Linux System Administrator's Manual"
20 pidof -- find the process ID of a running program.
28 .IR omitpid[,omitpid..] ]
30 .IR omitpid[,omitpid..].. ]
35 finds the process id's (pids) of the named programs. It prints those
36 id's on the standard output. This program is on some systems used in
37 run-level change scripts, especially when the system has a
38 \fISystem-V\fP like \fIrc\fP structure. In that case these scripts are
39 located in /etc/rc?.d, where ? is the runlevel. If the system has
42 (8) program that should be used instead.
45 Single shot - this instructs the program to only return one \fIpid\fP.
47 Only return process ids that are running with the same root directory.
48 This option is ignored for non-root users, as they will be unable to check
49 the current root directory of processes they do not own.
53 system function call on all binaries which are located on network
54 based file systems like
56 Instead of using this option the the variable
58 may be set and exported.
60 Scripts too - this causes the program to also return process id's of
61 shells running the named scripts.
62 .IP "-o \fIomitpid\fP"
63 Tells \fIpidof\fP to omit processes with that process id. The special
64 pid \fB%PPID\fP can be used to name the parent process of the \fIpidof\fP
65 program, in other words the calling shell or shell script.
69 At least one program was found with the requested name.
72 No program was found with the requested name.
74 \fIpidof\fP is actually the same program as \fIkillall5\fP;
75 the program behaves according to the name under which it is called.
77 When \fIpidof\fP is invoked with a full pathname to the program it
78 should find the pid of, it is reasonably safe. Otherwise it is possible
79 that it returns pids of running programs that happen to have the same name
80 as the program you're after but are actually other programs.
88 Miquel van Smoorenburg, miquels@cistron.nl