summaryrefslogtreecommitdiffstats
path: root/doc/pstree.1
blob: 87add47864b751eead807414a83ec5cbf1228452 (plain)
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
.\"
.\" Copyright 1993-2002 Werner Almesberger
.\"           2002-2014 Craig Small
.\" 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.
.\"
.TH PSTREE 1 "2014-01-31" "psmisc" "User Commands"
.SH NAME
pstree \- display a tree of processes
.SH SYNOPSIS
.ad l
.B pstree
.RB [ \-a  , \ \-\-arguments ]
.RB [ \-c  , \ \-\-compact ]
.RB [ \-h  , \ \-\-highlight\-all  , \ \-H \fIpid\fB  , \ \-\-highlight\-pid\ \fIpid\fB ]
.RB [ \-g  ] \ \-\-show\-pgids ]
.RB [ \-l  , \ \-\-long ]
.RB [ \-n  , \ \-\-numeric\-sort ]
.RB [ \-N  , \ \-\-ns\-sort \fIns\fB
.RB [ \-p  , \ \-\-show\-pids ]
.RB [ \-s  , \ \-\-show\-parents ]
.RB [ \-S  , \ \-\-ns-changes ]
.RB [ \-u  , \ \-\-uid\-changes ]
.RB [ \-Z  , \ \-\-security\-context ]
.RB [ \-A  , \ \-\-ascii  , \ \-G  , \ \-\-vt100  , \ \-U  , \ \-\-unicode ]
.RB [ \fIpid\fB  , \ \fIuser\fB]
.br
.B pstree
.RB \-V  , \ \-\-version
.ad b
.SH DESCRIPTION
.B pstree
shows running processes as a tree.  The tree is rooted at either
.I pid
or
.B init
if
.I pid
is omitted.  If a user name is specified, all process trees rooted at
processes owned by that user are shown.
.PP
.B pstree
visually merges identical branches by putting them in square brackets
and prefixing them with the repetition count, e.g.
.nf
.sp
    init\-+\-getty
         |\-getty
         |\-getty
         `\-getty
.sp
.fi
becomes
.nf
.sp
    init\-\-\-4*[getty]
.sp
.fi
.PP
.PP
Child threads of a process are found under the parent process and are
shown with the process name in curly braces, e.g.
.nf
.sp
    icecast2\-\-\-13*[{icecast2}]
.sp
.fi
.PP
If
.B pstree
is called as
.B pstree.x11
then it will prompt the user at the end of the line to press return and
will not return until that has happened.  This is useful for when
.B pstree
is run in a xterminal.
.PP
Certain kernel or mount parameters, such as the hidepid option for procfs,
will hide information for some processes. In these situations
.B pstree
will attempt to build the tree without this information, showing process
names as question marks.

.SH OPTIONS
.IP \fB\-a\fP
Show command line arguments.  If the command line of a process is
swapped out, that process is shown in parentheses.
.B \-a
implicitly disables compaction for processes but not threads.
.IP \fB\-A\fP
Use ASCII characters to draw the tree.
.IP \fB\-c\fP
Disable compaction of identical subtrees.  By default, subtrees are
compacted whenever possible.
.IP \fB\-G\fP
Use VT100 line drawing characters.
.IP \fB\-h\fP
Highlight the current process and its ancestors.  This is a no-op if
the terminal doesn't support highlighting or if neither the current
process nor any of its ancestors are in the subtree being shown.
.IP \fB\-H\fP
Like
.BR \-h ,
but highlight the specified process instead.  Unlike with
.BR \-h ,
.B pstree
fails when using
.B \-H
if highlighting is not
available.
.IP \fB\-g\fP
Show PGIDs.  Process Group IDs are shown as decimal numbers in
parentheses after each process name.
.B \-g
implicitly disables compaction.  If both PIDs and PGIDs are displayed
then PIDs are shown first.
.IP \fB\-l\fP
Display long lines.  By default, lines are truncated to either the COLUMNS
environment variable or the display width.  If neither of these methods work,
the default of 132 columns is used.
.IP \fB\-n\fP
Sort processes with the same ancestor by PID instead of by name. 
(Numeric sort.)
.IP \fB\-N\fP
Show individual trees for each namespace of the type specified.  The
available types are: ipc, mnt, net, pid, user, uts.  Regular users don't
have access to other users' processes information, so the output will be
limited.
.IP \fB\-p\fP
Show PIDs.  PIDs are shown as decimal numbers in parentheses after each
process name.
.B \-p
implicitly disables compaction.
.IP \fB\-s\fP
Show parent processes of the specified process.
.IP \fB\-S\fP
Show namespaces transitions.  Like \-N, the output is limited when running
as a regular user.
.IP \fB\-u\fP
Show uid transitions.  Whenever the uid of a process differs from the
uid of its parent, the new uid is shown in parentheses after the
process name.
.IP \fB\-U\fP
Use UTF-8 (Unicode) line drawing characters.  Under Linux 1.1-54 and
above, UTF-8 mode is entered on the console with
.B echo \-e '\\033%8'
and left with
.B echo \-e '\\033%@'
.IP \fB\-V\fP
Display version information.
.IP \fB\-Z\fP
(SELinux) Show security context for each process.  This flag will only
work if pstree is compilied with SELinux support.
.SH FILES
.TP
/proc
location of the proc file system
.SH BUGS
Some character sets may be incompatible with the VT100 characters.
.SH "SEE ALSO"
.BR ps (1),
.BR top (1).
.\"{{{}}}