0

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)

1 Answer 1

0

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.

1
  • That will give all files execute permission.
    – Mikel
    Feb 25, 2011 at 10:02

You must log in to answer this question.