PSTREE(1)
๐ธ PSTREE(1) ๐ธ
Okay bestie, this is the pstree manual page, from the User Commands section. It's giving tree-shaped process vibes ๐ณ๐
๐ฆ NAME
pstree โ display a tree of processes โจ
๐ SYNOPSIS
pstree [-a, --arguments] [-c, --compact-not] [-C, --color attr]
[-g, --show-pgids] [-h, --highlight-all, -H pid, --highlight-pid pid]
[-l, --long] [-n, --numeric-sort] [-N, --ns-sort ns] [-p, --show-pids]
[-s, --show-parents] [-S, --ns-changes] [-t, --thread-names]
[-T, --hide-threads] [-u, --uid-changes] [-Z, --security-context]
[-A, --ascii, -G, --vt100, -U, --unicode] [pid, user]
pstree -V, --version
โจ DESCRIPTION โจ
okay so pstree shows your running processes as a tree ๐ณ The tree is rooted at either pid, or at init if you leave pid out. If you give it a user name, you get every process tree rooted at a process that user owns ๐ซถ
pstree lowkey merges identical branches. It puts them in square brackets and adds the repetition count in front. For example:
init-+-getty
|-getty
|-getty
`-getty
becomes
init---4*[getty]
Child threads of a process hang out under the parent process and show up with the process name in curly braces, like this:
icecast2---13*[{icecast2}]
๐ If you call it as pstree.x11, it will ask you to press return at the end of the line, and it won't come back until you do. This is handy when you run it in a xterminal.
Some kernel or mount parameters, like the hidepid option for procfs, hide info for certain processes. When that happens, pstree tries its best to build the tree without that info, and shows the process names as question marks ๐คทโโ๏ธ
๐ OPTIONS ๐
-a,--argumentsโ show the command line arguments ๐ If a process's command line has been swapped out, that process gets shown in parentheses.-aalso turns off compaction for processes, but not for threads.-A,--asciiโ draw the tree with ASCII characters ๐ค-c,--compact-notโ turn off compaction of identical subtrees ๐ โโ๏ธ By default, subtrees get compacted whenever it's possible.-C,--color attrโ color the process name based on the attribute you give ๐ Right now the only valuepstreeaccepts isage, which colors by how old the process is. Processes younger than 60 seconds are green, ones newer than an hour are yellow, and everything else is red.-g,--show-pgidsโ show the PGIDs ๐ Process Group IDs appear as decimal numbers in parentheses after each process name. If you show both PIDs and PGIDs, the PIDs come first.-G,--vt100โ draw with VT100 line drawing characters ๐ง-h,--highlight-allโ highlight the current process and its ancestors โจ This does nothing if your terminal can't highlight, or if neither the current process nor any of its ancestors are in the subtree being shown.-H pid,--highlight-pid pidโ same vibe as-h, but you get to pick the process to highlight ๐ฏ Unlike-h,pstreefails when you use-Hand highlighting isn't available.-l,--longโ display long lines ๐ By default, lines get truncated to either theCOLUMNSenvironment variable or the display width. If neither of those works, it falls back to 132 columns.-n,--numeric-sortโ sort processes with the same parent by PID instead of by name ๐ข (Numeric sort, periodt.)-N ns,--ns-sort nsโ show separate trees for each namespace of the type you pick ๐ช The available types are:ipc,mnt,net,pid,time,user,uts. Regular users can't see other users' process info, so the output will be limited for them ๐-p,--show-pidsโ show the PIDs ๐ PIDs appear as decimal numbers in parentheses after each process name.-palso turns off compaction.-s,--show-parentsโ show the parent processes of the specified process ๐-S,--ns-changesโ show namespace transitions ๐ Just like-N, the output is limited when you run it as a regular user.-t,--thread-namesโ show full names for threads when they're available ๐งต-T,--hide-threadsโ hide threads and only show processes ๐ซฅ-u,--uid-changesโ show uid transitions ๐ชช Whenever a process's uid is different from its parent's uid, the new uid shows up in parentheses after the process name.-U,--unicodeโ draw with UTF-8 (Unicode) line drawing characters ๐ On Linux 1.1-54 and above, UTF-8 mode gets switched on at the console withecho -e ' 33%8'and switched off withecho -e ' 33%@'.-V,--versionโ display version information ๐-Z,--security-contextโ show the current security attributes of the process ๐ก๏ธ On SELinux systems, this is the security context.
๐๏ธ FILES
/procโ where the proc file system lives ๐
๐ BUGS
๐ Some character sets may not play nicely with the VT100 characters.
๐ซถ SEE ALSO
That's the tea, bestie ๐ pstree is from the psmisc package, dated 2021-06-21, and it's PSTREE(1) forever โจ๐ฆ๐
๐ฆ where this page comes from
- alpine 3.22: psmisc-doc 23.7-r0 ยท GPL-2.0-or-later
- alpine 3.23: psmisc-doc 23.7-r0 ยท GPL-2.0-or-later
- alpine 3.24: psmisc-doc 23.7-r0 ยท GPL-2.0-or-later
- arch rolling: psmisc 23.7-2 ยท GPL
- centos-stream 10: psmisc 23.6-8.el10 ยท GPL-2.0-or-later
- debian bookworm: psmisc 23.6-1 ยท GPL-2.0-or-later
- debian trixie: psmisc 23.7-2 ยท GPL-2.0-or-later
- fedora 43: psmisc 23.7-6.fc43 ยท GPL-2.0-or-later
- fedora 44: psmisc 23.7-7.fc44 ยท GPL-2.0-or-later
- nixos 26.05: psmisc 23.7
- nixpkgs unstable: psmisc 23.7
- opensuse-leap 16.0: psmisc 23.7-160000.2.2 ยท GPL-2.0-or-later
- opensuse-leap 16.0: psmisc 23.7-160000.2.2 ยท GPL-2.0-or-later
- opensuse-leap 16.0: psmisc 23.7-160000.2.2 ยท GPL-2.0-or-later
- opensuse-leap 16.0: psmisc 23.7-160000.2.2 ยท GPL-2.0-or-later
- ubuntu noble: psmisc 23.7-1build1 ยท GPL-2.0-or-later
- ubuntu questing: psmisc 23.7-2ubuntu1 ยท GPL-2.0-or-later
- ubuntu resolute: psmisc 23.7-2ubuntu2 ยท GPL-2.0-or-later
- ubuntu stonking: psmisc 23.7-2ubuntu2 ยท GPL-2.0-or-later
- Copyright 1993-2002 Werner Almesberger
- ๐ girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms