Running defaults command as root vs regular user

defaultsroot

I've used the defaults command to tweak my settings to some sane defaults, but I have been unsure if I should run them as root or as my regular user. Seems to work either way. It is possible to do both, so my question is: is there a difference?

Scripts like these that use defaults usually needs root, but I don't see why. Sometimes I have to reboot in order to see the change in effect.

Best Answer

Yes , it's different if you run as root or regular user. In the first case you have all permissions, the second you have the permission of the domain of the application. Not every time the permissions are the same.