Permissions and owners

The getfacl command

Shows the ACLs of a file or folder: permissions for specific users and groups.

Syntax

getfacl archivoTry it in the terminal →

Most useful options

-a, --accessShows only the access ACL, without the default ACL
-d, --defaultShows only a folder's default ACL, the one new files inherit
-R, --recursiveLists the ACLs of all files and folders inside, recursively
-s, --skip-baseSkips files that only have basic permissions (owner, group and others)
-t, --tabularTable format: ACL and default ACL side by side. Permissions cancelled by the mask show in capitals
-n, --numericShows numeric UIDs and GIDs instead of names
-c, --omit-headerDoes not print the three header lines: file, owner and group

Copy-ready examples

$ touch informe.txt && getfacl informe.txtsee the ACLs of a new file: only the basic permissions appear.

Example output

# file: informe.txt
# owner: alumno
# group: alumno
user::rw-
group::r--
other::r--
$ getfacl -d proyecto/the folder's default ACL, which new files created inside it inherit.
$ getfacl -R -s proyecto/lists only files and folders with real ACL entries, without the basic permissions.
$ getfacl -t informe.txtthe same information in table format, with the entries side by side.

You can try them in the browser terminal: it does not touch your computer.

Common errors

MessageCauseFix
getfacl: noexiste: No such file or directoryThe file does not exist or the name is misspelled.List the folder with ls and copy the exact name.

Typical mistakes

  • Even if there is no ACL, getfacl shows the basic permissions as entries.
  • To read a file's ACLs you need search access to the folder that contains it.
  • By default, getfacl follows symbolic links you pass on the command line and skips those it finds in subfolders.
  • A filesystem without ACL support shows only the traditional mode permissions.

Differences from similar commands

  • setfacl: writes the entries that getfacl shows. Use it afterwards to check the result of each change.
  • chmod: gives permissions only to the owner, the group and others. getfacl also shows the named entries.

Related commands

FAQ

What is the mask line?

It is the effective limit of permissions for groups and named users. It does not affect the owner or others.

What does the #effective comment mean?

It appears when an entry's permissions differ from the effective ones after the mask. With -e it is always shown.

Why do only folders have a default ACL?

Because that ACL only defines what new files created inside inherit, and a regular file contains no other files.

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course