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 1 "2020-12-22" "" "User Commands"
20 pidof -- find the process ID of a running program
29 .IR omitpid[,omitpid...]... ]
36 finds the process id's (pids) of the named programs. It prints those
37 id's on the standard output.
40 Single shot - this instructs the program to only return one \fIpid\fP.
42 Only return process ids that are running with the same root directory.
43 This option is ignored for non-root users, as they will be unable to check
44 the current root directory of processes they do not own.
46 Quiet mode, suppress any output and only sets the exit status accordingly.
48 Show also processes that do not have visible command line (e.g. kernel
51 Scripts too - this causes the program to also return process id's of
52 shells running the named scripts.
53 .IP "-o \fIomitpid\fP"
54 Tells \fIpidof\fP to omit processes with that process id. The special
55 pid \fB%PPID\fP can be used to name the parent process of the \fIpidof\fP
56 program, in other words the calling shell or shell script.
57 .IP "-S \fIseparator\fP"
58 Use \fIseparator\fP as a separator put between pids. Used only when
59 more than one pids are printed for the program.
60 The \fB\-d\fR option is an alias for this option for sysvinit
66 At least one program was found with the requested name.
69 No program was found with the requested name.
72 When using the \fI\-x\fP option,
74 only has a simple method for detecting scripts and will miss scripts that,
75 for example, use env. This limitation is due to how the scripts look in
82 Jaromir Capik <jcapik@redhat.com>