Command line and power tools
Useful after migrating from another Mac, or when an app cannot write somewhere it should.
find ~ ! -user "$(whoami)" 2>/dev/null
find /Applications -user root
Files owned by someone else are the usual cause of "you do not have permission" errors after a Migration Assistant transfer, because the old account's numeric user ID may not match the new one.
find ~ -type f -perm 777 # world-writable, usually wrong
find ~ -type f ! -perm -u+r # you cannot read your own file
find ~ -type d -perm -o+w # world-writable directories
sudo chown -R "$(whoami)" ~/Documents/ProblemFolder
Be precise about the path. A chown -R at the wrong level, especially with sudo, is one of the more effective ways to break a Mac.
chmod -R u+rw ~/Documents/ProblemFolder
find ~/Documents/Folder -type d -exec chmod 755 {} \;
find ~/Documents/Folder -type f -exec chmod 644 {} \;
That last pair is the standard shape: directories need execute to be traversable, files do not.
xattr -l somefile
xattr -d com.apple.quarantine somefile
The quarantine attribute is what triggers "downloaded from the internet" warnings. Removing it is occasionally necessary and should be done knowingly.
Finder's Locked checkbox in Get Info maps to a filesystem flag:
chflags nouchg somefile
That is the fix when a file refuses to move or delete despite correct permissions.
The numeric user ID from the old Mac may differ. sudo chown -R $(whoami) on the affected folder fixes it.
Sets the immutable flag, which is what Finder's Locked checkbox toggles.
Everywhere keeps track of every file on your Mac — including the folders Spotlight hides and drives you have unplugged. Free for a day, then $19 once.
Download for Mac