System Administration Guide: Security Services

How to Change Group Ownership of a File

Use the following procedure to change the group ownership of a file.

  1. Become superuser or assume an equivalent role.

  2. Change the group owner of a file by using the chgrp command.

    $ chgrp group filename


    Specifies the group name or GID of the new group of the file or directory. 


    Specifies the file or directory. 

    For information on setting up groups, see “Managing User Accounts and Groups (Overview)” in System Administration Guide: Basic Administration.

  3. Verify that the group owner of the file has changed.

    $ ls -l filename

Example—Changing Group Ownership of a File

In the following example, the group ownership on myfile is changed to the group scifi.

$ chgrp scifi myfile
$ ls -l myfile
-rwxrw-- 1 rimmer scifi 12985 Nov 12 16:28 myfile