Linux and Unix chgrp command
Quick links
About chgrp
Syntax
Examples
Linux and Unix main page
For system V, changes the group that has access to a file or directory.
chgrp newgroup filenames [-f] [-h]
| newgroup | Specifies the new group that you wish to allow access to. |
| filenames | Specifies the files that the newgroup has access to. |
| -f | Force. Do not report errors. |
| -h | If the file is a symbolic link, change the group of the symbolic link. Without this option, the group of the file referenced by the symbolic link is changed. |
| -R | Recursive. chgrp descends through the directory, and any subdirectories, setting the specified group ID as it proceeds. When a symbolic link is encountered, the group of the target file is changed (unless the -h option is specified), but no recursion takes place. |
chgrp hope file.txt
Change the group to hope for the file file.txt if present and the group hope is valid.
