in Mac

Setting File Owner in Terminal

Sometimes OS X won’t let you change the owner of file using Finder. Annoying. Here are the simple steps to do it in Terminal.

First if you are just looking for the command it’s:

sudo chown -R _new_owner /root/to/file.txt

Where _new_owner is the name of the new owner you want to assign to the file

Now the steps:

1. Open Terminal, which you will find in Applications -> Utilities
2. Type in sudo chown -R _new_owner
3. Type the file path OR drag the file from finder onto the line after _new_owner to make the path appear.
4. Hit the enter key
5. You may have to type your OSX login password if prompted
6. Repeat for any other files you want to change