Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

In my /var/www folder i have permission 2750 with the owner being root (unless i change it by hand) and the group being www-data.

I mv a folder into /var/www and i'd like to reset the permissions so everything is 2750 and for the group to be www-data, is it possible to do it in one command? or do i need to do multiple cmds? (its two commands, 3 if i want the same owner but it be nice to do it with one for this folder)

share|improve this question
up vote 1 down vote accepted

You still need two commands, but you can put them on one line:

chmod -R 2750 /var/www/folder && chgrp -R www-data /var/www/folder

The -R will apply the permissions to all the subdirectories and files within /var/www/folder/.

If you do this often, you can put a script with that command into your ~/bin directory and make it executable and just run that.

share|improve this answer
I think i'll do just that thanks and accepted – acidzombie24 Feb 25 '11 at 7:03
That will give all files execute permission. – Mikel Feb 25 '11 at 10:02

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.