problem with chmod command

41,752

Solution 1

Use this:

sudo chmod 0777 -R /var/www/

-R instead of -r.

Solution 2

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

From the chmod help:

-R, --recursive change files and directories recursively

Solution 3

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:
41,752

Related videos on Youtube

Santosh Linkha
Author by

Santosh Linkha

Updated on September 18, 2022

Comments

  • Santosh Linkha
    Santosh Linkha about 1 year

    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$ 
    
  • Santosh Linkha
    Santosh Linkha over 12 years
    well thanks to you both ... but what the hell happened? I had been using -r untill now, and suddenly .. -R
  • Octavian A. Damiean
    Octavian A. Damiean over 12 years
    There was no -r in chmod ever, there is only -R or --recursive.
  • Pedram
    Pedram over 12 years
    Yeah, chmod doesn't have any -r option.
  • Santosh Linkha
    Santosh Linkha over 12 years
    well, i had been doing -r until i updated my system yesterday .. on version 10.10
  • Pedram
    Pedram over 12 years
    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.