chgrp is a utility that changes the group associated with a file.
A file belongs to a user and to a group where one or more users could be associated.
It is similar to chown but chgrp only changes the group and not the owner of the file, while chown can change both of them. Usage
chgrp [options] group file-list
or <p class="codigo">chgrp [options] –reference=rfile file-list</p>
- Is the name or numeric group ID of the new group to assigned to file-list
- Is a list of the pathnames of the files whose group association is going to be changed.
- Is the pathname of a file whose group is going to become the new group associated to the file-list
-c, --changes Verbosely describe the action for each file whose group actually changes. -f, --silent, --quiet Do not print error messages about files whose group cannot be changed. -h, --no-dereference Act on symbolic links themselves instead of what they point to. Only available if the lchown system call is provided. -v, --verbose Verbosely describe the action or non-action taken for every file. -R, --recursive Recursively change the group ownership of directories and their contents.
Be aware that only the owner of a file or root will be able to change the group associated with that file.