Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing Ownership of a directory in OS X

I've installed homebrew, and am trying to change the write permissisons for the /usr/local/include directory.

When I run 'brew doctor', I get this error message:

Error: The /usr/local directory is not writable. Even if this directory was writable when you installed Homebrew, other software may change permissions on this directory. Some versions of the "InstantOn" component of Airfoil are known to do this.

You should probably change the ownership and permissions of /usr/local back to your user account.

I tried doing that with chown, but I'm pretty new at this and don't think I was running it correctly. I ran:

chown myusername /usr/local/include

I didn't get any error message, but when I run brew doctor it says I still lack permission to write to /usr/local/include.

Any help would be greatly appreciated!

Edit:

I'm getting an "operation not permitted" error.

cd /usr

chown myusername local

chown: local: Operation not permitted

like image 592
Graeme Avatar asked Jun 02 '12 20:06

Graeme


People also ask

Which is the command to change directory ownership?

Change the group owner of a file by using the chgrp command. Specifies the group name or GID of the new group of the file or directory.

How do I find the owner of a folder on a Mac?

How can I know what's the owner of a file in finder > get info? so, if there're permissions for several users, you'll see them listed first, THE BOTTOM-MOST USER IS THE OWNER.


2 Answers

Simple solution that worked for me:

  1. click on your background to go to finder
  2. click on go and go to folder /usr
  3. right click on local and do get info
  4. unlock the lock at the bottom
  5. click + sign and add your user to the list and give read/write privileges
  6. click on the gear sign at the bottom and choose apply to enclosed items to recurse under that directory and assign privileges too all directories beneath it.

type brew doctor from command prompt to test. My result:

Your system is ready to brew.

like image 85
clawsthatroll Avatar answered Sep 19 '22 12:09

clawsthatroll


You should use: sudo chown username folder

like image 38
Vadim Klyuzner Avatar answered Sep 18 '22 12:09

Vadim Klyuzner