pstree -p: Visualize the Process Parent/Child Tree

Display running processes as a tree with PIDs, so you can see exactly which process spawned which.

LinuxprocessmonitoringTerminalLow risk
Run pstree -p to draw the whole process hierarchy as a tree with each PID shown in parentheses, or pstree -p 12345 to show only the subtree rooted at one PID.

01Command

Command
$ pstree -p

02What it does

ps aux lists processes flatly, which makes it hard to tell who spawned whom; pstree draws the same information as an indented tree rooted at systemd. The -p flag appends each process's PID in parentheses, which is what makes the output actionable. Add -a to also show each process's full command-line arguments, useful when the program name alone is not enough.

03Risk

RiskLow risk
Requirementspstree (psmisc package; preinstalled on most distributions)

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • Ubuntu Manpage: pstree - display a tree of processes
    manpages.ubuntu.com · technical · 2026-09-17
    Evidence: "pstree shows running processes as a tree. The tree is rooted at either pid or init if pid is omitted." -p: "Show PIDs."
  • pstree - display a tree of processes
    man7.org · technical · 2026-09-17
    Evidence: "pstree shows running processes as a tree"; the -p option is documented as "Show PIDs" (parenthesized process IDs next to each name).

Last verified: 2026-09-19 · Category: System & Settings

06Related solutions