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).
Asked
Active
Viewed 5.0k times
2 Answers
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.
Laurent Giroud
- 195
- 9
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