Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to change ownership on a file but am having trouble, before it used to work, now I think I am using the wrong syntax,

chown -R Person:User **

or is it users? I tried both and none work, what am I doing wrong? Also I am logged as root.

share|improve this question
add comment

3 Answers

It's actually "owner:group", meaning that you have to provide a username for the first and a groupname for the second argument. Giving a username as the second argument should lead to an error if there is no group of the same name.

share|improve this answer
    
I tried all sorts of combination, the problem wasn't the syntax though it was a capitalization error. Thanks Mrokii you helped clarify it for me. –  Brayan Hernandez Jul 12 '12 at 17:17
add comment

Mrokii is correct; in addition,if you are trying to change ownership on a single file you don't need the -R (recursive option) as one has to be very careful when recursively changing ownership of files. Also, logging in as root is not usually done in Ubuntu desktop unless you do it via the ctrl-alt-fn virtual terminals just for the duration of that session then return to the graphical desktop.

share|improve this answer
    
Yes I used the -R intentionally. I like working from root because of less hassle when trying to access certain things within the system. But I log in as root using "sudo -i" is that not the same as the root you speak of? –  Brayan Hernandez Jul 12 '12 at 17:20
    
Yes it's the same thing -a root login shell. –  user76204 Jul 12 '12 at 17:26
add comment
up vote 0 down vote accepted
chown -R me:users **

Worked, I was capitalizing on the first letter, apparently that is a no no.

share|improve this answer
add comment

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.