To change only the group ownership of a file or directory in Linux, you can use the chgrp command. The basic syntax is:
chgrp NEW_GROUP FILE
NEW_GROUPis the name of the new group you want to assign.FILEis the name of the file or directory whose group ownership you want to change.
For example, to change the group of a file named example.txt to developers, you would use:
chgrp developers example.txt
This command will change the group ownership without affecting the user ownership.
