{
    "mode": "man",
    "parameter": "pstree",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/pstree/1/json",
    "generated": "2026-06-04T16:35:03Z",
    "synopsis": "pstree [-a, --arguments] [-c, --compact-not] [-C, --color attr] [-g, --show-pgids]\n[-h, --highlight-all, -H pid, --highlight-pid pid] [-l, --long] [-n, --numeric-sort]\n[-N, --ns-sort ns] [-p, --show-pids] [-s, --show-parents] [-S, --ns-changes] [-t, --thread-\nnames] [-T, --hide-threads] [-u, --uid-changes] [-Z, --security-context]\n[-A, --ascii, -G, --vt100, -U, --unicode] [pid, user]\npstree -V, --version",
    "sections": {
        "NAME": {
            "content": "pstree - display a tree of processes\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "pstree [-a, --arguments] [-c, --compact-not] [-C, --color attr] [-g, --show-pgids]\n[-h, --highlight-all, -H pid, --highlight-pid pid] [-l, --long] [-n, --numeric-sort]\n[-N, --ns-sort ns] [-p, --show-pids] [-s, --show-parents] [-S, --ns-changes] [-t, --thread-\nnames] [-T, --hide-threads] [-u, --uid-changes] [-Z, --security-context]\n[-A, --ascii, -G, --vt100, -U, --unicode] [pid, user]\npstree -V, --version\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "pstree shows running processes as a tree.  The tree is rooted at either pid or init if pid is\nomitted.  If a user name is specified, all process trees rooted at processes  owned  by  that\nuser are shown.\n\npstree  visually  merges  identical branches by putting them in square brackets and prefixing\nthem with the repetition count, e.g.\n\ninit-+-getty\n|-getty\n|-getty\n`-getty\n\nbecomes\n\ninit---4*[getty]\n\n\nChild threads of a process are found under the parent process and are shown with the  process\nname in curly braces, e.g.\n\nicecast2---13*[{icecast2}]\n\n\nIf  pstree  is  called  as  pstree.x11 then it will prompt the user at the end of the line to\npress return and will not return until that has happened.  This is useful for when pstree  is\nrun in a xterminal.\n\nCertain kernel or mount parameters, such as the hidepid option for procfs, will hide informa‐\ntion for some processes. In these situations pstree will attempt to build  the  tree  without\nthis information, showing process names as question marks.\n\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-a",
                    "content": "process is shown in parentheses.  -a implicitly disables compaction for processes  but\nnot threads.\n",
                    "flag": "-a"
                },
                {
                    "name": "-A",
                    "content": "",
                    "flag": "-A"
                },
                {
                    "name": "-c",
                    "content": "possible.\n",
                    "flag": "-c"
                },
                {
                    "name": "-C",
                    "content": "which colors by process age.  Processes newer than 60 seconds are green, newer than an\nhour yellow and the remaining red.\n",
                    "flag": "-C"
                },
                {
                    "name": "-g",
                    "content": "process  name.   -g  implicitly  disables compaction.  If both PIDs and PGIDs are dis‐\nplayed then PIDs are shown first.\n",
                    "flag": "-g"
                },
                {
                    "name": "-G",
                    "content": "",
                    "flag": "-G"
                },
                {
                    "name": "-h",
                    "content": "doesn't  support  highlighting or if neither the current process nor any of its ances‐\ntors are in the subtree being shown.\n",
                    "flag": "-h"
                },
                {
                    "name": "-H -h -h",
                    "content": "when using -H if highlighting is not available.\n",
                    "flag": "-h"
                },
                {
                    "name": "-l",
                    "content": "variable or the display width.  If neither of these methods work, the default  of  132\ncolumns is used.\n",
                    "flag": "-l"
                },
                {
                    "name": "-n",
                    "content": "",
                    "flag": "-n"
                },
                {
                    "name": "-N",
                    "content": "are: ipc, mnt, net, pid, time, user, uts.  Regular users don't have  access  to  other\nusers' processes information, so the output will be limited.\n",
                    "flag": "-N"
                },
                {
                    "name": "-p",
                    "content": "-p implicitly disables compaction.\n",
                    "flag": "-p"
                },
                {
                    "name": "-s",
                    "content": "",
                    "flag": "-s"
                },
                {
                    "name": "-S -N",
                    "content": "user.\n",
                    "flag": "-N"
                },
                {
                    "name": "-t",
                    "content": "",
                    "flag": "-t"
                },
                {
                    "name": "-T",
                    "content": "",
                    "flag": "-T"
                },
                {
                    "name": "-u",
                    "content": "ent, the new uid is shown in parentheses after the process name.\n",
                    "flag": "-u"
                },
                {
                    "name": "-U",
                    "content": "is entered on the console with echo -e ' 33%8' and left with echo -e ' 33%@'.\n",
                    "flag": "-U"
                },
                {
                    "name": "-V",
                    "content": "",
                    "flag": "-V"
                },
                {
                    "name": "-Z",
                    "content": "the security context.\n",
                    "flag": "-Z"
                }
            ]
        },
        "FILES": {
            "content": "/proc  location of the proc file system\n",
            "subsections": []
        },
        "BUGS": {
            "content": "Some character sets may be incompatible with the VT100 characters.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "ps(1), top(1), proc(5).\n\n\n\npsmisc                                       2021-01-05                                    PSTREE(1)",
            "subsections": []
        }
    },
    "summary": "pstree - display a tree of processes",
    "flags": [
        {
            "flag": "-a",
            "long": null,
            "arg": null,
            "description": "process is shown in parentheses. -a implicitly disables compaction for processes but not threads."
        },
        {
            "flag": "-A",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-c",
            "long": null,
            "arg": null,
            "description": "possible."
        },
        {
            "flag": "-C",
            "long": null,
            "arg": null,
            "description": "which colors by process age. Processes newer than 60 seconds are green, newer than an hour yellow and the remaining red."
        },
        {
            "flag": "-g",
            "long": null,
            "arg": null,
            "description": "process name. -g implicitly disables compaction. If both PIDs and PGIDs are dis‐ played then PIDs are shown first."
        },
        {
            "flag": "-G",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-h",
            "long": null,
            "arg": null,
            "description": "doesn't support highlighting or if neither the current process nor any of its ances‐ tors are in the subtree being shown."
        },
        {
            "flag": "-h",
            "long": null,
            "arg": null,
            "description": "when using -H if highlighting is not available."
        },
        {
            "flag": "-l",
            "long": null,
            "arg": null,
            "description": "variable or the display width. If neither of these methods work, the default of 132 columns is used."
        },
        {
            "flag": "-n",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-N",
            "long": null,
            "arg": null,
            "description": "are: ipc, mnt, net, pid, time, user, uts. Regular users don't have access to other users' processes information, so the output will be limited."
        },
        {
            "flag": "-p",
            "long": null,
            "arg": null,
            "description": "-p implicitly disables compaction."
        },
        {
            "flag": "-s",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-N",
            "long": null,
            "arg": null,
            "description": "user."
        },
        {
            "flag": "-t",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-T",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-u",
            "long": null,
            "arg": null,
            "description": "ent, the new uid is shown in parentheses after the process name."
        },
        {
            "flag": "-U",
            "long": null,
            "arg": null,
            "description": "is entered on the console with echo -e ' 33%8' and left with echo -e ' 33%@'."
        },
        {
            "flag": "-V",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-Z",
            "long": null,
            "arg": null,
            "description": "the security context."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "ps",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ps/1/json"
        },
        {
            "name": "top",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/top/1/json"
        },
        {
            "name": "proc",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/proc/5/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "A convenient tool to show running processes as a tree.",
        "examples": [
            {
                "description": "Display a tree of all processes (rooted at init)",
                "command": "pstree"
            },
            {
                "description": "Display a tree of processes with PIDs",
                "command": "pstree {{-p|--show-pids}}"
            },
            {
                "description": "Display all process trees rooted at processes owned by specified user",
                "command": "pstree {{user}}"
            },
            {
                "description": "Display command line arguments",
                "command": "pstree {{-a|--arguments}}"
            },
            {
                "description": "Display children of a specified process",
                "command": "pstree {{pid}}"
            },
            {
                "description": "Display parents of a specified process",
                "command": "pstree {{-s|--show-parents}} {{pid}}"
            }
        ]
    }
}