chown(1)

chown(1)

NAME

chown, chgrp - change ®le owner or group

SYNOPSIS

chown [-h][-R]owner[:group] ®le ...

chgrp [-h][-R]group ®le ...

DESCRIPTION

The chown command changes the owner ID of each speci®ed ®le to owner and optionally the group ID of each speci®ed ®le to group.

The chgrp command changes the group ID of each speci®ed ®le to group.

owner can be either a decimal user ID or a login name found in the /etc/passwd ®le.

group can be either a decimal group ID or a group name found in the /etc/group ®le.

In order to change the owner or group, you must own the ®le and have the CHOWN privilege (see setprivgrp(1M)). If either command is invoked on a regular ®le by other than the superuser, the set-user- ID and set-group-ID bits of the ®le mode (04000 and 02000 respectively) are cleared. Note that a given user's or group's ability to use this command can be restricted by setprivgrp (see setprivgrp(1M)).

Access Control Lists HFS File Systems Only

Users can permit or deny speci®c individuals and groups to access a ®le by setting optional ACL entries in the ®le's access control list (see acl(5)). When using chown in conjunction with HFS ACLs, if the new owner and/or group of a ®le does not have an optional ACL entry corresponding to user.% and/or %.group in the ®le's access control list, the ®le's access permission bits remain unchanged. However, if the new owner and/or group is already designated by an optional ACL entry of user.% and/or %.group in the ®le's ACL, chown sets the corresponding ®le access permission bits (and the corresponding base ACL entries) to the permissions contained in that entry.

Access Control Lists JFS File Systems Only

Users can permit or deny speci®c individuals and groups to access a ®le by setting optional ACL entries in the ®le's access control list (see aclv(5)). When using chown in conjunction with JFS ACLs, if the new owner and/or group of a ®le have optional ACL entries corresponding to user:uid:perm and/or group:gid:perm in the ®le's access control list, those entries remain in the ACL but no longer have any effect, being superseded by the ®le's user::perm and/or group::perm entries.

Options

chown and chgrp recognize the following options:

-hChange the owner or group of a symbolic link.

By default, the owner or group of the target ®le that a symbolic link points to is changed. With -h, the target ®le that the symbolic link points to is not affected. If the target ®le is a directory, and you specify -hand -R, recursion does not take place.

-RRecursively change the owner or group. For each ®le operand that names a directory, the owner or group of the directory and all ®les and subdirectories in the ®le hierarchy below it are changed.

EXTERNAL INFLUENCES

Environment Variables

LC_MESSAGES determines the language in which messages are displayed.

If LC_MESSAGES is not speci®ed in the environment or is set to the empty string, the value of LANG is used as a default for each unspeci®ed or empty variable. If LANG is not speci®ed or is set to the empty string, a default of "C" (see lang(5)) is used instead of LANG.

If any internationalization variable contains an invalid setting, chown behaves as if all internationalization variables are set to "C". See environ(5).

International Code Set Support

Single- and multi-byte character code sets are supported.

c

HP-UX Release 11i: December 2000

− 1 −

Section 187