How to change only the group?

QuestionsQuestions8 SkillsProPermissions of FilesOct, 02 2025
095

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_GROUP is the name of the new group you want to assign.
  • FILE is 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.

0 Comments

no data
Be the first to share your comment!