#!/bin/sh DIR="/srv/partage" GROUP="partage" chgrp -hR "${GROUP}" "${DIR}"/ find "${DIR}"/ \ \( -type d -not -perm 2770 -exec chmod ug=rwx,g+s,o= "{}" \; \) , \ \( -type f -not -perm 0660 -exec chmod ug=rw,o= "{}" \; \)