File: pidof.1

package info (click to toggle)
procps 2%3A3.3.15-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 6,888 kB
  • sloc: ansic: 22,696; sh: 5,035; makefile: 527; exp: 384; sed: 16
file content (74 lines) | stat: -rw-r--r-- 2,450 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
'\" -*- coding: UTF-8 -*-
.\" Copyright (C) 1998 Miquel van Smoorenburg.
.\"
.\" This program is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 2 of the License, or
.\" (at your option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with this program; if not, write to the Free Software
.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
.\"
.TH PIDOF 1 "2018-03-03" "" "User Commands"
.SH NAME
pidof -- find the process ID of a running program.
.SH SYNOPSIS
.B pidof
.RB [ \-s ]
.RB [ \-c ]
.RB [ \-x ]
.RB [ \-o
.IR omitpid[,omitpid..] ]
.RB [ \-o
.IR omitpid[,omitpid..].. ]
.RB [ \-S
.IR separator ]
.B program
.RB [ program.. ]
.SH DESCRIPTION
.B Pidof
finds the process id's (pids) of the named programs. It prints those
id's on the standard output.
.SH OPTIONS
.IP \-s
Single shot - this instructs the program to only return one \fIpid\fP.
.IP \-c
Only return process ids that are running with the same root directory.
This option is ignored for non-root users, as they will be unable to check
the current root directory of processes they do not own.
.IP \-x
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.
.IP "-S \fIseparator\fP"
Use \fIseparator\fP as a separator put between pids. Used only when
more than one pids are printed for the program.
.SH "EXIT STATUS"
.TP
.B 0
At least one program was found with the requested name.
.TP
.B 1
No program was found with the requested name.

.SH BUGS
When using the \fI\-x\fP option,
.B pidof
only has a simple method for detecting scripts and will miss scripts that,
for example, use env. This limitation is due to how the scripts look in
the proc filesystem.

.SH SEE ALSO
.BR pgrep (1),
.BR pkill (1)
.SH AUTHOR
Jaromir Capik <jcapik@redhat.com>