Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Something strange happened with my Downloads directory on my Mac OSX v 10.7.5. All of a sudden I wasn't permitted to save anything to the directory. The directory is in users/kelly/ and is the only one in that directory which doesn't have myname as the owner and group, instead it's root wheel:

drwxr-xr-x  104 root        wheel        3.5K Jan  1 20:55 Downloads/

When I try to change permissions with chown, ie:

kelly@kellys-MacBook-Pro:~$ chown -R kelly:kelly Downloads/

I get this response:

chown: Downloads//ftp/incoming: Operation not permitted
chown: Downloads//ftp: Operation not permitted
chown: Downloads/: Operation not permitted

When I try to just delete the whole directory it says permission denied. My reasoning here was that I could just delete the whole thing and make a new downloads directory.

What's the deal? That ftp thing seems scetchy but I really don't know where to go from here... Thanks so much for you time!

share|improve this question

1 Answer 1

The only accounts that are allowed to change the owner of a directory or file is the owner or the file and root. In this case, those are the same one...

Assuming that you have administrator rights on the computer, you thus simply need to run the command with root permissions:

$ sudo chown -R kelly:kelly Downloads/

When asked for a password, enter your own password.

If you don't have sudo rights, ask someone who does - or rename the directory and create a new one. As Stéphane reminded me, you can't delete the directory as long as it's not empty, and you won't be able to delete the files within it unless they're owned by you.

share|improve this answer
    
You cannot delete a directory if it's not empty. And you can't remove files from a directory unless you have write access to it. He could rename it though. –  Stéphane Chazelas May 30 at 7:47
    
Thanks @StéphaneChazelas. I will inject some more caffeine before the next answer. –  Jenny D May 30 at 7:57
    
YES! Thanks, by adding sudo it worked. Only put this off for about 6 months... :) –  Kelly May 30 at 8:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.