What is the Mac terminal command to remove ACL?

27

7

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

Posted 2011-06-20T19:27:34.693

Reputation: 271

Answers

45

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

Posted 2011-06-20T19:27:34.693

Reputation: 28 538

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 – 2018-08-12T19:24:10.373

@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 – 2018-08-12T23:56:20.753

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 – 2018-08-13T01:34:37.363

4

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

geekosaur

Posted 2011-06-20T19:27:34.693

Reputation: 10 195