Created
September 1, 2013 03:10
-
-
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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