1PSTREE(1) User Commands PSTREE(1)
2
3
4
6 pstree - display a tree of processes
7
9 pstree [-a, --arguments] [-c, --compact-not] [-C, --color attr]
10 [-g, --show-pgids] [-h, --highlight-all, -H pid, --highlight-pid pid]
11 [-l, --long] [-n, --numeric-sort] [-N, --ns-sort ns] [-p, --show-pids]
12 [-s, --show-parents] [-S, --ns-changes] [-t, --thread-names]
13 [-T, --hide-threads] [-u, --uid-changes] [-Z, --security-context]
14 [-A, --ascii, -G, --vt100, -U, --unicode] [pid, user]
15 pstree -V, --version
16
18 pstree shows running processes as a tree. The tree is rooted at either
19 pid or init if pid is omitted. If a user name is specified, all
20 process trees rooted at processes owned by that user are shown.
21
22 pstree visually merges identical branches by putting them in square
23 brackets and prefixing them with the repetition count, e.g.
24
25 init-+-getty
26 |-getty
27 |-getty
28 `-getty
29
30 becomes
31
32 init---4*[getty]
33
34
35 Child threads of a process are found under the parent process and are
36 shown with the process name in curly braces, e.g.
37
38 icecast2---13*[{icecast2}]
39
40
41 If pstree is called as pstree.x11 then it will prompt the user at the
42 end of the line to press return and will not return until that has hap‐
43 pened. This is useful for when pstree is run in a xterminal.
44
45 Certain kernel or mount parameters, such as the hidepid option for
46 procfs, will hide information for some processes. In these situations
47 pstree will attempt to build the tree without this information, showing
48 process names as question marks.
49
50
52 -a Show command line arguments. If the command line of a process
53 is swapped out, that process is shown in parentheses. -a im‐
54 plicitly disables compaction for processes but not threads.
55
56 -A Use ASCII characters to draw the tree.
57
58 -c Disable compaction of identical subtrees. By default, subtrees
59 are compacted whenever possible.
60
61 -C Color the process name by given attribute. Currently pstree only
62 accepts the value age which colors by process age. Processes
63 newer than 60 seconds are green, newer than an hour yellow and
64 the remaining red.
65
66 -g Show PGIDs. Process Group IDs are shown as decimal numbers in
67 parentheses after each process name. If both PIDs and PGIDs are
68 displayed then PIDs are shown first.
69
70 -G Use VT100 line drawing characters.
71
72 -h Highlight the current process and its ancestors. This is a no-
73 op if the terminal doesn't support highlighting or if neither
74 the current process nor any of its ancestors are in the subtree
75 being shown.
76
77 -H Like -h, but highlight the specified process instead. Unlike
78 with -h, pstree fails when using -H if highlighting is not
79 available.
80
81 -l Display long lines. By default, lines are truncated to either
82 the COLUMNS environment variable or the display width. If nei‐
83 ther of these methods work, the default of 132 columns is used.
84
85 -n Sort processes with the same parent by PID instead of by name.
86 (Numeric sort.)
87
88 -N Show individual trees for each namespace of the type specified.
89 The available types are: ipc, mnt, net, pid, time, user, uts.
90 Regular users don't have access to other users' processes infor‐
91 mation, so the output will be limited.
92
93 -p Show PIDs. PIDs are shown as decimal numbers in parentheses af‐
94 ter each process name. -p implicitly disables compaction.
95
96 -s Show parent processes of the specified process.
97
98 -S Show namespaces transitions. Like -N, the output is limited
99 when running as a regular user.
100
101 -t Show full names for threads when available.
102
103 -T Hide threads and only show processes.
104
105 -u Show uid transitions. Whenever the uid of a process differs
106 from the uid of its parent, the new uid is shown in parentheses
107 after the process name.
108
109 -U Use UTF-8 (Unicode) line drawing characters. Under Linux 1.1-54
110 and above, UTF-8 mode is entered on the console with echo -e
111 ' 33%8' and left with echo -e ' 33%@'.
112
113 -V Display version information.
114
115 -Z Show the current security attributes of the process. For SELinux
116 systems this will be the security context.
117
119 /proc location of the proc file system
120
122 Some character sets may be incompatible with the VT100 characters.
123
125 ps(1), top(1), proc(5).
126
127
128
129psmisc 2021-06-21 PSTREE(1)