Examples (5)
Set capability `cap_net_raw` (to use RAW and PACKET sockets) for a given file
setcap 'cap_net_raw' path/to/fileSet multiple capabilities on a file (`ep` behind the capability means "effective permitted")
setcap 'cap_dac_read_search,cap_sys_tty_config+ep' path/to/fileRemove all capabilities from a file
setcap -r path/to/fileVerify that the specified capabilities are currently associated with the specified file
setcap -v 'cap_net_raw' path/to/fileThe optional `-n root_uid` argument can be used to set the file capability for use only in a user namespace with this root user ID owner
setcap -n root_uid 'cap_net_admin' path/to/filemade by @shridhargupta | data from tldr-pages