chmod – change file mode bits


File attributes

lsattr – list file attributes on a Linux second extended file system

$ lsattr /tmp/testdir/testfile
-----a---------- testdir/testfile

chattr – change file attributes on a Linux file system

Cannot delete file because “immutable” attribute is set.

chattr -a /tmp/testdir/testfile
chattr -i /tmp/testdir/testfile




getfacl – get file access control lists

setfacl – set file access control lists

-b, --remove-allRemove all extended ACL entries. The base ACL entries of the owner, group and others are retained.
-k, --remove-defaultRemove the Default ACL. If no Default ACL exists, no warnings are issued.
-d, --defaultAll operations apply to the Default ACL. Regular ACL entries in the input set are promoted to Default ACL entries. Default ACL entries in the input set are discarded. (A warning is issued if that happens).
-R, --recursiveApply operations to all files and directories recursively. This option cannot be mixed with `–restore’.
-m, --modifymodify the ACL of a file or directory
-x, --removeremove ACL entries

Clear all ACLs

setfacl -bk folder

Add/modify the bareos group to rx

setfacl -m g:bareos:rx folder

removes access for the “other” user

setfacl -m "other::---" somefolder
setfacl -dm "other::---" somefolder

Examples from the man page

Granting an additional user read access
      setfacl -m u:lisa:r file

Revoking write access from all groups and all named users (using the effective rights mask)
      setfacl -m m::rx file

Removing a named group entry from a file's ACL
      setfacl -x g:staff file

Copying the ACL of one file to another
      getfacl file1 | setfacl --set-file=- file2

Copying the access ACL into the Default ACL
      getfacl --access dir | setfacl -d -M- dir


FlagLinux nameWindows meaning
rread_dataList folder / Read data
wwrite_dataCreate files / Write data
xexecuteTraverse folder / Execute file
pappend_dataCreate folder / Append data
Ddelete_childDelete subfolders and files
aread_attributesRead attributes
Awrite_attributesWrite attributes
Rread_xattrRead extended attributes
Wwrite_xattrWrite extended attributes
cread_aclRead permissions
Cwrite_aclChange permissions
owrite_ownerTake ownership