Use the following procedure to change the group ownership of a file.
Change the group owner of a file by using the chgrp command.
$ chgrp group filename |
group |
Specifies the group name or GID of the new group of the file or directory. |
filename |
Specifies the file or directory. |
For information on setting up groups, see “Managing User Accounts and Groups (Overview)” in System Administration Guide: Basic Administration.
Verify that the group owner of the file has changed.
$ ls -l filename |
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 |