Selected topic
Permissions
Prefer practical output? Use related tools below while reading.
chgrp is a command-line utility used to change the group ownership of a file or directory on a Linux system. It allows you to modify the group that owns a particular file, which affects the permissions and access control.
bash
chgrp [options] group file ...-h : Changes only the symbolic link itself, not what it points to.-R : Recursively changes the group ownership of all files and directories within a directory tree.--from=group : Specify the old group name.bash
chgrp developers myfile.txtmyfile.txt to developers.bash
chgrp -R developers /var/www/html
Here, we recursively change the group ownership of all files and directories within /var/www/html to developers.bash
chgrp developers myfile.txt myotherfile.txt
In this example, we change the group ownership of both myfile.txt and myotherfile.txt to developers.
chgrp newgroup file.chmod 664 -R after running chgrp.chgrp, as changing group ownership can affect access control and permissions.chown to change both user and group ownership at once, if needed.