How to a group own a file

filesgroupls

Whe I do ls -l, two of the fields are username of the owner and name of the owning group.

The username is clear – I created the file, it is mine. However the group entry confuses me. My user is a member of several groups. What is so special about the group with the name same as my username, that it owns newly created files and not some other group e.g. sudoers.

Best Answer

The group entry comes from your primary group, which, by default, is the same as your username.

A new user is assigned to his/her own group which contains only him, hence its called private group. So, until a user deliberately changes the group ownership of a file, it will belong to the user as owner and private group as group owner. http://linuxers.org/article/difference-between-primary-and-secondary-groups-linux