Changes the group ownership of a file or directory.
chgrp [ -f ] [ -h ] [ -R ] Group { File ... | Directory ... }
The chgrp command changes the group associated with the specified file or directory to the specified group name or group ID number. When a symbolic link is encountered and you have not specified the -h flag, the chgrp command changes the group ownership of the file or directory pointed to by the link and not the group ownership of the link itself.
If you specify the -h flag, the chgrp command has the opposite effect and changes the group ownership of the link itself and not that of the file or directory pointed to by the link.
If you specify both the -h flag and the -R flag, the chgrp command descends the specified directories recursively, and when a symbolic link is encountered, the group ownership of the link itself is changed and not that of the file or directory pointed to by the link.
This command returns the following
exit values:
0 | Successful completion. |
>0 | An error occurred. |
chgrp staff proposals
The group access permissions for proposals now apply to the staff group.
chgrp -R staff proposals
The group access permissions for proposals and for all the files and subdirectories under it now apply to the staff group.
/usr/bin/chgrp | The chgrp command |
/etc/group | File that identifies all known groups |
The chown command, groups command.
The chown subroutine, fchown subroutine.
Security Administration in AIX 5L Version 5.1 System Management Concepts: Operating System and Devices describes system security.
File Ownership and User Groups in AIX 5L Version 5.1 System User's Guide: Operating System and Devices introduces file ownership and permissions to access files and directories.