How to change group ownership of files and directories on Linux

To change group ownership of files and directories

Every user is a member of one or more groups. To find out which groups you belong to use the command:
    groups
To find out which groups another user belongs to use the command:
    groups username
Your files and directories are owned by the group (or one of the groups) that you belong to. This is known as their "group ownership".

To list the group ownership of your files:
    ls -gl
You can change the group ownership of a file or directory with the command:
    chgrp group_name file/directory_name
You must be a member of the group to which you are changing ownership to.

Comments