1PSTREE(1) User Commands PSTREE(1)
2
3
4
6 pstree - display a tree of processes
7
9 pstree [-a] [-c] [-h|-Hpid] [-l] [-n] [-p] [-u] [-Z] [-A|-G|-U]
10 [pid|user]
11 pstree -V
12
14 pstree shows running processes as a tree. The tree is rooted at either
15 pid or init if pid is omitted. If a user name is specified, all process
16 trees rooted at processes owned by that user are shown.
17
18 pstree visually merges identical branches by putting them in square
19 brackets and prefixing them with the repetition count, e.g.
20
21 init-+-getty
22 |-getty
23 |-getty
24 `-getty
25
26 becomes
27
28 init---4*[getty]
29
30
31 Child threads of a process are found under the parent process and are
32 shown with the process name in curly braces, e.g.
33
34 icecast2---13*[{icecast2}]
35
36
37 If pstree is called as pstree.x11 then it will prompt the user at the
38 end of the line to press return and will not return until that has hap‐
39 pened. This is useful for when pstree is run in a xterminal.
40
41
43 -a Show command line arguments. If the command line of a process is
44 swapped out, that process is shown in parentheses. -a implicitly
45 disables compaction.
46
47 -A Use ASCII characters to draw the tree.
48
49 -c Disable compaction of identical subtrees. By default, subtrees
50 are compacted whenever possible.
51
52 -G Use VT100 line drawing characters.
53
54 -h Highlight the current process and its ancestors. This is a no-op
55 if the terminal doesn't support highlighting or if neither the
56 current process nor any of its ancestors are in the subtree
57 being shown.
58
59 -H Like -h, but highlight the specified process instead. Unlike
60 with -h, pstree fails when using -H if highlighting is not
61 available.
62
63 -l Display long lines. By default, lines are truncated to the dis‐
64 play width or 132 if output is sent to a non-tty or if the dis‐
65 play width is unknown.
66
67 -n Sort processes with the same ancestor by PID instead of by name.
68 (Numeric sort.)
69
70 -p Show PIDs. PIDs are shown as decimal numbers in parentheses
71 after each process name. -p implicitly disables compaction.
72
73 -u Show uid transitions. Whenever the uid of a process differs from
74 the uid of its parent, the new uid is shown in parentheses after
75 the process name.
76
77 -U Use UTF-8 (Unicode) line drawing characters. Under Linux 1.1-54
78 and above, UTF-8 mode is entered on the console with echo -e
79 '\033%8' and left with echo -e '\033%@'
80
81 -V Display version information.
82
83 -Z (SELinux) Show security context for each process.
84
86 /proc location of the proc file system
87
89 Werner Almesberger <werner@almesberger.net> Craig Small
90 <csmall@small.dropbear.id.au>
91
93 Some character sets may be incompatible with the VT100 characters.
94
95
97 ps(1), top(1).
98
99
100
101Linux 2004-11-09 PSTREE(1)