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 don't know what is happening

experimentx@workmateX:/var/www$ sudo chmod 0777 -r /var/www/

chmod: cannot access `0777': No such file or directory

experimentx@workmateX:/var/www$ 
share|improve this question
add comment

3 Answers 3

up vote 7 down vote accepted

Use this:

sudo chmod 0777 -R /var/www/

-R instead of -r.

share|improve this answer
    
well thanks to you both ... but what the hell happened? I had been using -r untill now, and suddenly .. -R –  Santosh Linkha Apr 7 '11 at 8:31
2  
There was no -r in chmod ever, there is only -R or --recursive. –  Octavian Damiean Apr 7 '11 at 8:41
    
Yeah, chmod doesn't have any -r option. –  Pedram Apr 7 '11 at 8:49
    
well, i had been doing -r until i updated my system yesterday .. on version 10.10 –  Santosh Linkha Apr 8 '11 at 7:15
    
I don't know what happened in your case but chmod is one the commands that are common between all linux distributions and has nothing to the with a specific version of ubuntu. –  Pedram Apr 8 '11 at 7:27
add comment

Use "-R" instead of "-r".

From the chmod help:

-R, --recursive change files and directories recursively

share|improve this answer
    
thank you too !!! –  Santosh Linkha Apr 7 '11 at 8:32
add comment

Also note that the 0 will no longer clear suid/sgid/sticky in recent versions of chmod and you'll soon have to use a symbolic mode (if that's what you're intending to do).

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.