File Permissions

setfacl

Set Access Control Lists (ACLs) to grant fine-grained permissions.

Synopsis

syntax
setfacl [OPTION]... ACL_SPEC FILE...

Examples

Grant alice read-write access
setfacl -m u:alice:rw file.txt
Grant devs group read-execute
setfacl -m g:devs:rx project/
Remove alice's ACL entry
setfacl -x u:alice file.txt
Recursively grant bob read access
setfacl -R -m u:bob:r /shared

Common options

FlagDescription
-mModify ACL entries
-xRemove ACL entries
-bRemove all ACL entries
-RApply recursively
-dSet default ACL for new files in directory

About setfacl

The `setfacl` command set Access Control Lists (ACLs) to grant fine-grained permissions. File permission commands control access to files and directories on Linux.

The Unix permission model uses owner, group, and other categories with read, write, and execute bits. Properly managing permissions is essential for system security, multi-user environments, and running services that require specific access levels.

The command accepts 5 commonly used flags shown above, though the full set of options is available in the man page (`man setfacl`). The 4 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.

Related commands

More File Permissions Commands

Other commands in the File Permissions category

Related tools