CAPTREE(8)

๐Ÿ“ฆ
version 2.78 ยท 3 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, fedora 43, fedora 44, nixpkgs unstable

๐Ÿ‘‘ CAPTREE(8) โ€” the process capability tree, bestie edition ๐Ÿ’…

okay so this is captree from the System Manager's Manual, and it's genuinely one of my faves. sit down, hydrate, let's go ๐Ÿซถ


โœจ NAME โœจ

captree โ€” display tree of process capabilities ๐ŸŒณ


๐ŸŒธ SYNOPSIS ๐ŸŒธ

captree [OPTIONS] [(pid|glob-name) ...]

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

captree displays the capabilities on the mentioned processes indicated by pid or glob-name value(s) given on the command line. no cap, that's literally the whole job. ๐ŸŽ€

and here's the tea on defaults, bestie:

  • if you supply no pid etc values at all, pid=1 is implied. surprise! it just picks init for you ๐Ÿ’€
  • a pid value of 0 displays all the processes known to the kernel. the whole squad. every single one. ๐ŸŒˆ

The POSIX.1e capabilities are displayed in double quotes in the cap_from_text(3) format. so like, in quotes, that format, got it? โœจ

The IAB tuple of capabilities is displayed between square brackets in the text format described in cap_iab(3). Both of these text formats are described in cap_text_formats(7). ๐Ÿ“š

note bestie: the IAB tuple text is omitted if it contains empty A and B components. this is because the regular POSIX.1e text contains information about the Inheritable flag already. it's giving redundant, lowkey. ๐Ÿ’…

and this behavior can be overridden with the --verbose command line argument. the override is RIGHT THERE, use it ๐Ÿซถ


Optional arguments, and listen โ€” they must precede the list of pid|glob-name values. like, they go FIRST. no pushing in line, bestie ๐Ÿ˜ญ

  • --help โ€” Displays usage information and exits. Note, modern Go runtimes exit with status 0 in this case, but older runtimes exit with status 2. yeah. the exit code depends on how vintage your Go runtime is. iconic behavior honestly ๐Ÿ™ˆ
  • --verbose โ€” Displays capability sets and IAB tuples even when they are empty, or redundant. no more hiding the empty ones, we're showing EVERYTHING ๐Ÿ’–
  • --depth=n โ€” Displays the process tree to a depth of n. Note, the default value for this parameter is 0, which implies infinite depth. yes bestie, zero means infinity here, we don't make the rules ๐ŸŒˆ
  • --colo[u]r=false โ€” Colo[u]rs the targeted PIDs, if stdout is a TTY, in red. This option defaults to true when running via a TTY. The --color=false argument will suppress this color. Piping the output into some other program will also suppress the use of colo[u]r. so like โ€” pipe it and the red just โœจevaporatesโœจ, no flag needed ๐ŸŽ€

๐Ÿ’€ EXIT STATUS ๐Ÿ’€

  • If the supplied target cannot be found the exit status is 1. ๐Ÿ˜ญ
  • Should an unrecognized option be provided, the exit status is 2. ๐Ÿ™ˆ
  • Otherwise, captree exits with status 0. slay ๐Ÿ’…

๐Ÿ› REPORTING BUGS ๐Ÿ›

Please report bugs via:

https://bugzilla.kernel.org/buglist.cgi?component=libcap&list_id=1090757

don't be shy, they wanna hear it ๐Ÿซถ


๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

cap_from_text(3), cap_text_formats(7), capabilities(7), and cap_iab(3).

There is a longer article about captree, which includes some examples, here:

https://sites.google.com/site/fullycapable/captree

go read it, iykyk ๐Ÿ“–โœจ


๐Ÿซถ AUTHOR ๐Ÿซถ

Andrew G. Morgan <morgan@kernel.org> โ€” thank you for your service, king ๐Ÿ‘‘


and that's the whole page, bestie!! this one came from the System Manager's Manual and it's dated 2022-03-19 โ€” go forth and captree responsibly, mwah ๐Ÿ’–๐ŸŽ€๐Ÿฆ‹๐ŸŒธ

๐Ÿ“ฆ where this page comes from