Skip to content

Instantly share code, notes, and snippets.

@kennwhite
Created September 1, 2013 03:10
Show Gist options
  • Save kennwhite/6402096 to your computer and use it in GitHub Desktop.
Save kennwhite/6402096 to your computer and use it in GitHub Desktop.
Remove all extended attributes recursively on an OSX directory & files and fix "chown: ... Operation not permitted" and "chmod: ... Operation not permitted"
# This is the nuclear option. Use with extreme care
# Works up to and including Mountain Lion (10.8.x)
# Show all extended attributes
ls -lOe ~/dir-to-fix
# Remove no-change attributes
sudo chflags nouchg ~/dir-to-fix
# Recursively clear all entended attributes
sudo xattr -rc ~/dir-to-fix
# The reset to rational owner & perms
sudo chown -R username:staff ~/dir-to-fix
sudo chmod -R 0700 ~/dir-to-fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment