file permissions, flags and acls

in addition to the usual posix file permissions, mac hfs file systems can also assign acls (access control lists) and flags to files and directories. these are useful to protect system resources, or limit changes by remote users when accessed via file sharing methods (afp, nfs, smb, etc.)

some tips

  • to display extended attributes and sizes in long (-l) output, use ls -l@

  • to include file flags in long output, use ls -lO

  • to change file flags, use chflags. the most useful variation is chflags -R nouchg,noschg . which removes the user immutable and system immutable flags recursively from the current directory. note that this can only be done by root.

  • to adjust acl’s, use chmod. a useful invocation is chmod -N which removes all acl’s from a file. chmod -NR . has proven useful…