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)

link|improve this question

55% accept rate
feedback

1 Answer

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.

link|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
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.