Linux - Get and Set Acl Utilities (Backup, Restore File Permissions)

> Operating System - Kernel (Windows, Unix, Linux) > Linux / Unix

1 - About

getfacl displays:

  • the file name,
  • owner, the group,
  • and the Access Control List (ACL).

If a directory has a default ACL, getfacl also displays the default ACL.

The setacl utility sets Access Control Lists (ACLs) of files and directories.

3 - Steps

3.1 - Backup

getfacl -R /my/path > permissions.acl

3.2 - Restore

setfacl --restore=permissions.acl

4 - Documentation / Reference

Advertising