getcap(8)

getcap8

Examine file capabilities

Usage

getcap [-v] [-n] [-r] [-h] filename []

Overview

getcap displays the name and capabilities of each specified file.

Options

-h

prints quick usage.

-n

prints any non-zero user namespace root user ID value found to be associated with a file's capabilities.

-r

enables recursive search.

-v

display all searched entries, even if the have no file-capabilities.

NOTE: an empty value of '=' is not equivalent to an omitted (or removed) capability on a file. This is most significant with respect to the Ambient capability vector, since a process with Ambient capabilities will lose them when executing a file having '=' capabilities, but will retain the Ambient inheritance of privilege when executing a file with an omitted file capability. This special empty setting can be used to prevent a binary from executing with privilege. For some time, the kernel honored this suppression for root executing the file, but the kernel developers decided after a number of years that this behavior was unexpected for the superuser and reverted it just for that user identity. Suppression of root privilege, for a process tree, is possible, using the capsh(1) --mode option.

filename

One file per line.

Releases

12 releases since Debian 3.0 (Woody); the text changed 6 times.

  1. 3.0–3.1
  2. 5.0
  3. 6.0–7
  4. 8–10
  5. 11
  6. 12
  7. 13–Arch

-h since Debian 5.0 (Lenny); -n since Debian 11 (Bullseye); -r since Debian 5.0 (Lenny); -v since Debian 5.0 (Lenny).

Reporting bugs

Please report bugs via:

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

From libcap 2.78-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.