Saturday, March 30, 2013

Change a directory's group on *nix

chgrp usergroup somedir
If you want to change the directory's contents too, simply append the -R option to the chgrp command as shown below:
chgrp -R usergroup somedir
Note that somedir could also be a file (it doesn't have to be a directory). Also, if you want to change a directory's owner simply switch chgrp to chown. The options between the two commands are the same.

No comments:

Post a Comment