FILECAP:(8)
π FILECAP π (that's section 8 of the system administration utilities, bestie, and it's a whole vibe)
β¨ NAME β¨
filecap β a program to see capabilities π«Ά
okay so literally the whole point is peeking at which files have capabilities attached to them. iconic behavior tbh.
πΈ SYNOPSIS πΈ
filecap [ -a | -d | /dir | /dir/file [cap1 cap2 ...] ]
π¦ DESCRIPTION π¦
So filecap is this little program that prints out a report of programs with file based capabilities. That's it, that's the job. π
And listen β if a file isn't in the report, or there's literally no report at all? That means no capabilities were found. No cap. It's giving "nothing to see here." π
Now here's the part where you gotta pay attention, bestie. For expedience β which is just a fancy way of saying "so it doesn't take forever" β the default is to check only the directories in the PATH environmental variable. So it's checking the places you're actually likely to run stuff from. Makes sense, right? Main character energy. π
But then:
- If you give it the
-acommand line option, then all directories will be checked. Like, the whole entire system. Go off. π₯ - If you pass a directory, it will recursively check that directory. Recursive queen. π§
- If you give it a path to a file, it will only check that file. Just that one. Nothing else.
- And if a file is given followed by capabilities, then the capabilities are written to the file. βοΈ (yes this one actually changes stuff, so be normal about it)
π OPTIONS π
-aβ This tells the program to show all capabilities starting from the/directory. Normally thePATHenvironmental variable is used to show you capabilities on files you are likely to execute. But with-a? We're going full sweep, no crumbs left. π-dβ This dumps all capabilities for reference. Like a little encyclopedia of capabilities, but make it terminal. πβ¨
β EXAMPLES β
To check file capabilities in $PATH:
filecap
To check file capabilities of whole system:
filecap -a
To check file capabilities recursively in a directory:
filecap /usr
To check file capabilities of a specific program:
filecap /bin/passwd
To list all possible capabilities:
filecap -d
To set a file capability on a specific program:
filecap /bin/ping net_raw net_admin
To remove file capabilities on a specific program:
filecap /bin/ping none
π heads up bestie: that second-to-last one and the last one actually write to the file β setting caps withnet_raw net_admin, and clearing them withnone. The rest are just lookin'. Don't get it twisted. π
π SEE ALSO π
pscap(8), netcap(8), capabilities(7).
go read those too, they're the friend group. π«Ά
π AUTHOR π
Steve Grubb
and that's the whole page, bestie π this one came out of <strong>Red Hat</strong>, dated <strong>Aug 2018</strong> β so yeah, it's a classic, it ate, and it's still serving. periodt. β¨πΈ
π¦ where this page comes from
- arch rolling: libcap-ng 0.9.6-1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 43: libcap-ng-utils 0.9.6-1.fc43 Β· GPL-2.0-or-later
- fedora 44: libcap-ng-utils 0.9.6-1.fc44 Β· GPL-2.0-or-later
- nixpkgs unstable: libcap-ng 0.9.6
- ubuntu stonking: libcap-ng-utils 0.9.6-1 Β· LGPL-2.1-or-later
- π the page's license: GPL-2.0-or-later
- Copyright (c) 2009,2017-18 Red Hat Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms