File Permissions
chgrp
Change group ownership of files and directories.
Synopsis
syntax
chgrp [OPTION]... GROUP FILE...
Examples
Change directory group
chgrp developers project/
Recursively change group
chgrp -R staff /shared
Copy group from reference file
chgrp --reference=ref.txt target.txt
Common options
| Flag | Description |
|---|---|
| -R | Operate recursively |
| -v | Verbose output |
| -c | Report only changes |
| --reference | Use group of reference file |
About chgrp
The `chgrp` command change group ownership of files and directories. File permission commands control access to files and directories on Linux.
The Unix permission model uses owner, group, and other categories with read, write, and execute bits. Properly managing permissions is essential for system security, multi-user environments, and running services that require specific access levels.
The command accepts 4 commonly used flags shown above, though the full set of options is available in the man page (`man chgrp`). The 3 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.
Related commands
More File Permissions Commands
Other commands in the File Permissions category