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, -Hpid, --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
54 implicitly 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 age which colors by process age. Processes newer than
63 60 seconds are green, newer than an hour yellow and the remain‐
64 ing red.
65
66 -g Show PGIDs. Process Group IDs are shown as decimal numbers in
67 parentheses after each process name. -g implicitly disables
68 compaction. If both PIDs and PGIDs are displayed then PIDs are
69 shown first.
70
71 -G Use VT100 line drawing characters.
72
73 -h Highlight the current process and its ancestors. This is a no-
74 op if the terminal doesn't support highlighting or if neither
75 the current process nor any of its ancestors are in the subtree
76 being shown.
77
78 -H Like -h, but highlight the specified process instead. Unlike
79 with -h, pstree fails when using -H if highlighting is not
80 available.
81
82 -l Display long lines. By default, lines are truncated to either
83 the COLUMNS environment variable or the display width. If nei‐
84 ther of these methods work, the default of 132 columns is used.
85
86 -n Sort processes with the same ancestor by PID instead of by name.
87 (Numeric sort.)
88
89 -N Show individual trees for each namespace of the type specified.
90 The available types are: ipc, mnt, net, pid, user, uts. Regular
91 users don't have access to other users' processes information,
92 so the output will be limited.
93
94 -p Show PIDs. PIDs are shown as decimal numbers in parentheses
95 after each process name. -p implicitly disables compaction.
96
97 -s Show parent processes of the specified process.
98
99 -S Show namespaces transitions. Like -N, the output is limited
100 when running as a regular user.
101
102 -t Show full names for threads when available.
103
104 -T Hide threads and only show processes.
105
106 -u Show uid transitions. Whenever the uid of a process differs
107 from the uid of its parent, the new uid is shown in parentheses
108 after the process name.
109
110 -U Use UTF-8 (Unicode) line drawing characters. Under Linux 1.1-54
111 and above, UTF-8 mode is entered on the console with echo -e
112 ' 33%8' and left with echo -e ' 33%@'
113
114 -V Display version information.
115
116 -Z (SELinux) Show security context for each process. This flag
117 will only work if pstree is compiled with SELinux support.
118
120 /proc location of the proc file system
121
123 Some character sets may be incompatible with the VT100 characters.
124
126 ps(1), top(1).
127
128
129
130psmisc 2019-10-23 PSTREE(1)