System Administration Guide
Chapter 1, Administering user accounts

Setting the group ID for file creation in a directory

Setting the group ID for file creation in a directory

By default, the GID (group identifier) of a newly created file is set to the GID of the creating process or user. Setting the SGID bit on a directory causes all subsequent new files to take the GID of that directory. This makes it easier for users to share files, because it ensures that all files will have the same GID, even if the users don't have the same login group.

To set the SGID bit on a directory, use this command, substituting the directory name for directory: 

chmod g+s directory

To remove the bit, replace the ``+'' with a ``-'' in the chmod command.