Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

with this command

sudo chmod 777 /var/www/

I get 777 on www but not under www/subdir1/subdir2 how can I set all subdirectories recursively to 777 with one command?

share|improve this question
this has been asked before, and it is always noted as a bad idea. just for reference:… – RobotHumans Aug 25 '12 at 1:33
oh I could not find it.. – themhz Aug 25 '12 at 1:34
up vote 1 down vote accepted

Use the -R flag.

so the command would be sudo chmod -R 777 /var/www/.

This is, however a bad idea and you should normally do it one at a time.

share|improve this answer
ok thanx, I will use it wisely – themhz Aug 25 '12 at 2:24

Your Answer


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.