Bump to procps-ng 3.3.17
[platform/upstream/procps-ng.git] / pidof.1
1 '\" -*- coding: UTF-8 -*-
2 .\" Copyright (C) 1998 Miquel van Smoorenburg.
3 .\"
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.
8 .\"
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.
13 .\"
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
17 .\"
18 .TH PIDOF 1 "2020-12-22" "" "User Commands"
19 .SH NAME
20 pidof -- find the process ID of a running program
21 .SH SYNOPSIS
22 .B pidof
23 .RB [ \-s ]
24 .RB [ \-c ]
25 .RB [ \-q ]
26 .RB [ \-w ]
27 .RB [ \-x ]
28 .RB [ \-o
29 .IR omitpid[,omitpid...]... ]
30 .RB [ \-S
31 .IR separator ]
32 .B program
33 .RB [ program... ]
34 .SH DESCRIPTION
35 .B Pidof
36 finds the process id's (pids) of the named programs. It prints those
37 id's on the standard output.
38 .SH OPTIONS
39 .IP \-s
40 Single shot - this instructs the program to only return one \fIpid\fP.
41 .IP \-c
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.
45 .IP \-q
46 Quiet mode, suppress any output and only sets the exit status accordingly.
47 .IP \-w
48 Show also processes that do not have visible command line (e.g. kernel
49 worker threads).
50 .IP \-x
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
61 .B pidof
62 compatibility.
63 .SH "EXIT STATUS"
64 .TP
65 .B 0
66 At least one program was found with the requested name.
67 .TP
68 .B 1
69 No program was found with the requested name.
70
71 .SH BUGS
72 When using the \fI\-x\fP option,
73 .B pidof
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
76 the proc filesystem.
77
78 .SH SEE ALSO
79 .BR pgrep (1),
80 .BR pkill (1)
81 .SH AUTHOR
82 Jaromir Capik <jcapik@redhat.com>