Beginner Package: coreutils

chgrp

Change the group that owns a file or directory.

Syntax

chgrp [options] group file

Description

chgrp changes only the group ownership of a file, which is useful when several users who share a group need write access without changing the file's user owner.

Examples

chgrp developers project/
Set the group owner of a directory
chgrp -R staff /shared/docs
Recursively change group ownership of a directory tree

Applies to

Ubuntu Debian Linux Mint RHEL CentOS / Rocky / AlmaLinux Fedora Arch Linux openSUSE Alpine Linux