Open System Services Shell and Utilities Reference Manual (G06.28+, H06.05+)

User Commands (c) chgrp(1)
NAME
chgrp - Changes the group ownership of a le or directory
SYNOPSIS
chgrp [ -W NOG ][-W NOE ][-fhR] group le ... |
The chgrp command changes the group associated with the specied le or directory to
group.
FLAGS
-f Suppresses all error reporting.
-h Changes the group ownership of a symbolic link, instead of the le to which the sym- |
bolic link points. When you use this ag, the chgrp command does not affect the le |
pointed to by the symbolic link. If you use the -R ag with this ag, recursion does not |
take place.
-R Causes chgrp to descend recursively through its directory arguments, setting the
specied group ID. If chgrp fails to change the group ID of a particular le in the
hierarchy, it continues to process the remaining les. If chgrp cannot read or process a
directory in the hierarchy, it continues to process the other parts of the hierarchy. |
When symbolic links are encountered and the -h ag is not used, the group ownership |
of the parent le or directory changes, but the group ownership of linked les or direc- |
tories does not change. If you use the -h ag with this ag, recursion does not take |
place.
HP Extensions
-W NOG Species that the /G directory should be omitted when the initial directory is root
and the recursive ag (-R) is used. This ag is ignored when the initial directory
is not /, /E,or/E/system or when recursion does not occur.
-W NOE Species that the /E directory should be omitted when the initial directory is root
and the recursive ag (-R) is used. This ag is ignored when the initial directory
is not root or when recursion does not occur.
Specify both the -W NOG and -W NOE ags to omit both the /G and /E directories.
DESCRIPTION
The effective user of the process must match the owner of the le.
Users can change the group of a le to a group that they belong to (their effective group or one of
their supplementary groups). If you do not own the le and do not belong to the new group, you
must have superuser authority to change the group name or group ID.
The group argument must be either a valid group name or a valid group ID that exists in the
group database. If a numeric group operand exists in the group database as a group name, the
group ID number associated with that group name is used as the group ID.
Access Control Lists (ACLs)
A user can allow or deny specic individuals and groups access to a le by using the access con- |
trol list (ACL) for the le. When using the chgrp() function in conjunction with ACLs, if the |
new owner and/or group of a le have optional ACL entries corresponding to user:uid:perm or |
group:gid:perm in the ACL for a le, those entries remain in the ACL but no longer have any |
effect because they are superseded by the user::perm or group::perm entries in the ACL. |
Access control lists (ACLs) are not supported for symbolic links. |
For more information about ACLs, see the acl(5) reference page.
527188-007 Hewlett-Packard Company 239