40

I'm trying to find the terminal command on a Mac to remove ACL to fix user permissions on a folder that gives an error code when I try to copy it (error code -41).

Teresa
  • 401
  • 1
  • 4
  • 3

2 Answers2

61

Using chmod -a allows one to remove access control entries individually (as @geekosaur suggested).

But if you are looking to remove all ACLs from a file or folder, the solution is to use the brute-force option: chmod -N which removes all access control entries for a file or folder.

chmod -RN will do the same recursively for a folder and its entire contents.

Gordon Davisson
  • 34,084
  • 5
  • 66
  • 70
  • You know, the funny thing here is that in the man page indicates `chmod -a# 1 file1` to remove attributes based on their numeric assignment as shown via `ls -le` -- this doesn't seem to work. Anyone have some specific examples of this working? – ylluminate Aug 12 '18 at 19:24
  • @ylluminate I've used it that way. Are you quoting/escaping the `#` character (to keep it from being treated as a comment delimiter), as in `chmod -a\# 1 filename` or `chmod '-a#` 1 filename`? – Gordon Davisson Aug 12 '18 at 23:56
  • Good call @gordon-davisson, this particular workstation of ZSH was supposed to not require escaping of `#` on this particular workstation, but it did and that solved it. – ylluminate Aug 13 '18 at 01:34
4

It's all bundled into the chmod command; take a look at the -a/+a/=a options in the manpage.

geekosaur
  • 11,723
  • 32
  • 40