chmod g+s .; This command sets the "set group ID" (setgid) mode bit on the current directory, written as ..
This means that all new files and subdirectories created within the current directory inherit the group ID of the directory, rather than the primary group ID of the user who created the file. This will also be passed on to new subdirectories created in the current directory.
g+s affects the files' group ID but does not affect the owner ID.
Note that this applies only to newly-created files. Files that are moved (mv) into the directory are unaffected by the setgid setting. Files that are copied with cp -p are also unaffected.
Example
touch un; chgrp canard .; chmod g+s .; touch deux ; In this case, deux will belong to group canard but un will belong to the group of the user creating it, whatever that is.
Minor Note on the Use of Semicolons in Shell Commands
Unlike C or Perl, a shell command only needs to be followed by a semicolon if there is another shell command following it on the same command line. Thus, consider the following command line:
chgrp canard .; chmod g+s .; The final semicolon is superfluous and can be removed:
chgrp canard .; chmod g+s . Further, if we were to place the two commands on separate lines, then the remaining semicolon is unneeded:
chgrp canard . chmod g+s . Documentation
As an added noteFor more information, I think thesee man chmod. Also, wikipedia has tables fromsummarizing the Wikipedia article on chmod are very helpful. Because I use them often, recalling the equivalence of w=write and r=read and x=execute is easy for me, but because I use it rarely, I'm always forgetting that s=setuid/gid, so I add it here in case it helps others toocommand options.