Back to the command reference

pstree

ProcessesFundamentals In simulator In real Linux

Show processes as a tree

Name: pstree = process tree

You can practise it right away in the simulator, and use it in real Linux mode too.

Description

pstree draws processes as a tree of parents and children, rooted at PID 1 (usually systemd). -p adds PIDs; great for seeing which process started which.

Syntax

pstree [OPTION]... [PID|USER]

Common options

-p / --show-pidsShow PIDs
-a / --argumentsShow command-line arguments
-u / --uid-changesShow user changes
-h / --highlight-allHighlight this process and its ancestors
-s / --show-parentsShow the ancestors of the given process
-n / --numeric-sortSort by process ID
-T / --hide-threadsLeave out threads

Examples

  • $ pstree -p

    The whole process hierarchy

    Explain
  • $ pstree -p 1001

    Children of one process

    Explain

Related