| GETCAP(1) | General Commands Manual | GETCAP(1) |
getcap —
capability database access utility
getcap |
[-b boolean |
-c capability |
-n number |
-s string]
-f path
-a | record ... |
The getcap utility provides a simple
method for querying a capability database such as
/etc/login.conf or
/etc/printcap and as described by
cgetent(3).
The following query types are supported:
getcap prints the value associated with
the given key. If more than one record is being searched, the value is
prefixed with the record name (for records with multiple names, only the
first is printed). If a key has no associated value and a boolean query is
not being performed, a blank line will be printed.
The options are as follows:
-a-b
boolean-c
capability-f
path-n
number-s
stringOnly one of the -b,
-c, -n, and
-s options may be specified. If none are specified,
the record will be dumped from the database as is.
Find all login.conf(5) entries with the “ignorenologin” capability:
$ getcap -f /etc/login.conf -a -b
ignorenologinDump the “default” record in login.conf(5):
$ getcap -f /etc/login.conf
defaultPrint all login.conf(5) records with the “localcipher” capability:
$ getcap -f /etc/login.conf -a -s
localcipherPrint the “datasize-max” capability in the “staff” record in login.conf(5) if it exists:
$ getcap -f /etc/login.conf -s
datasize-max staffPrint all printcap(5) entries that reference /dev/lp. Note that we are treating the entire string “lp=/dev/lp” as a boolean flag instead of a key/value pair.
$ getcap -f /etc/printcap -a -b
lp=/dev/lpcap_mkdb(1), cgetent(3), login.conf(5), printcap(5), termcap(5)
The getcap command appeared in
OpenBSD 3.7.
Todd C. Miller
| September 2, 2019 | Debian |