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 have the same GID, even if the users do not 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(1) command.