Linux – How to make files created in a directory owned by directory group

file managementlinuxpermissionsunix

Is there a way, on Linux, to cause all new files created in a directory to be owned by the directory's group instead of the creating user's group?

Best Answer

If you chmod g+s directory then all the files created in that directory will be owned by that group.

newgroup is really a holdover from the days when you could only be in one group, and isn't really needed nowadays.