commands.sh

setfacl

linux

Set file access control lists (ACL).

More info →

Options (4)

-m, --modifyboolean

Modify ACL of a file for user with read and write access

Example: setfacl {{[-m|--modify]}} u:{{username}}:rw {{path/to/file_or_directory}}
-d, --defaultboolean

Modify default ACL of a file for all users

Example: setfacl {{[-d|--default]}} {{[-m|--modify]}} u::rw {{path/to/file_or_directory}}
-x, --removeboolean

Remove ACL of a file for a user

Example: setfacl {{[-x|--remove]}} u:{{username}} {{path/to/file_or_directory}}
-b, --remove-allboolean

Remove all ACL entries of a file

Example: setfacl {{[-b|--remove-all]}} {{path/to/file_or_directory}}

Examples (4)

Modify ACL of a file for user with read and write access

setfacl [-m|--modify] u:username:rw path/to/file_or_directory

Modify default ACL of a file for all users

setfacl [-d|--default] [-m|--modify] u::rw path/to/file_or_directory

Remove ACL of a file for a user

setfacl [-x|--remove] u:username path/to/file_or_directory

Remove all ACL entries of a file

setfacl [-b|--remove-all] path/to/file_or_directory
made by @shridhargupta | data from tldr-pages