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

I am using ubuntu 10.04,I need to give execute permission in www folder.But by mistake i gave execute permission in whole var folder.

sudo chmod -R 777 /var
Then i try to change it into normal permission.For that i gave
sudo chmod -R 775 /var/
And again i gave execute permission only www folder.But the problem is my index.html file is not run which is located in inside the www folder. How to restore the default permission on the /var directory/folder.

share|improve this question

The quick answer is that you're screwed. There is no undo. Be careful what you do with sudo. The quick solution is to reinstall.

But as this is just /var we could perhaps try to fix it. I could for example run this command on my system:

 find /var -exec stat --format "chmod %a %n" {} \; > /tmp/

This would give a script that you could run, and would try to reset all permissions as they are on my system. This should fix most issues. But I'm not sure how similar my installation is, as I'm using 12.10.

share|improve this answer
Very smart, life saver. Thanks ! – Stuffix May 13 at 22:27

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.