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 file or directory
SYNOPSIS
chgrp [ -W NOG ][-W NOE ][-fhR] group file ... |
The chgrp command changes the group associated with the specified file or directory to
group.
FLAGS
-f Suppresses all error reporting.
-h Changes the group ownership of a symbolic link, instead of the file to which the sym- |
bolic link points. When you use this flag, the chgrp command does not affect the file |
pointed to by the symbolic link. If you use the -R flag with this flag, recursion does not |
take place.
-R Causes chgrp to descend recursively through its directory arguments, setting the
specified group ID. If chgrp fails to change the group ID of a particular file in the
hierarchy, it continues to process the remaining files. 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 flag is not used, the group ownership |
of the parent file or directory changes, but the group ownership of linked files or direc- |
tories does not change. If you use the -h flag with this flag, recursion does not take |
place.
HP Extensions
-W NOG Specifies that the /G directory should be omitted when the initial directory is root
and the recursive flag (-R) is used. This flag is ignored when the initial directory
is not /, /E,or/E/system or when recursion does not occur.
-W NOE Specifies that the /E directory should be omitted when the initial directory is root
and the recursive flag (-R) is used. This flag is ignored when the initial directory
is not root or when recursion does not occur.
Specify both the -W NOG and -W NOE flags to omit both the /G and /E directories.
DESCRIPTION
The effective user of the process must match the owner of the file.
Users can change the group of a file to a group that they belong to (their effective group or one of
their supplementary groups). If you do not own the file 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 specific individuals and groups access to a file by using the access con- |
trol list (ACL) for the file. When using the chgrp() function in conjunction with ACLs, if the |
new owner and/or group of a file have optional ACL entries corresponding to user:uid:perm or |
group:gid:perm in the ACL for a file, 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 2−39