Home·Terminal commands

getfacl

Permissions

Usage

getfacl [path]

Prints the access control list, the extra per-user rights beyond owner, group and others; it is Linux with the acl package, while macOS shows its own kind of ACL with ls -le.

Common flags

FlagMeaning
-RWalk a whole tree
-dShow the default ACL that new files will inherit
-aShow only the ACL of the file itself
--omit-headerLeave out the three comment lines
-ePrint the effective rights after the mask is applied

Examples

getfacl report.pdf

The ACL plus the ordinary owner and group bits.

getfacl dir | setfacl --set-file=- other_dir

Copies one ACL onto another directory.

ls -le report.pdf

How macOS shows its own kind of ACL instead.

Numeric and symbolic modes name the same thing: 755 and u=rwx,go=rx are the same permission.

How to read this

  • Square brackets [ ] mark a part you may leave out.
  • An ellipsis … means you can list more than one.
  • Flags are case-sensitive — in some commands -r and -R do different things.

Questions

Q. What does getfacl do?

Prints the access control list, the extra per-user rights beyond owner, group and others; it is Linux with the acl package, while macOS shows its own kind of ACL with ls -le.

Q. How do I type it?

getfacl [path] — square brackets mark the parts you can leave out.

Q. How many flags are worth knowing?

5 are listed here; the full set is in man getfacl. This command sits under Permissions.

Related commands

man page: man getfacl