chmod g+s

这个意思是让 group 变得 sticky。所以新文件会继承 parent directory 的 group。

比如,下面吧所有 /data 目录都变成 group sticky,然后又都设置为 staff。这样里面新建的文件就会是 staff group 的了。

find /data -type d | xargs chmod g+s
chgrp -R staff /data