Paco

Personal Content Organiser

Home / Linux

Navigation

Menu

Search

Default group on file creation

On *nix systems, there are two possible ways that the group on a new file is determined. The method is determined by the state of the group ID bit on the directoy in which the file is being created.

If the group ID bit for the directory is off, the group used is a random selection (probably the last loginable group of the user) from the groups to which the user belongs.

If the group ID bit is set, the group for the file is taken from the directory in which the file is being created. In this case, it does not matter if the user is a member of that group.

To set the group ID bit on a directory,

chmod g+s directory


To clear the group ID bit on a directory,

chmod g-s directory



zrodlo: http://www.cs.rutgers.edu/~watrous/default-group.html