chown(1)
NAME
chown, chgrp − change file owner or group
SYNOPSIS
chown [−R] owner file ...
chgrp [−R] group file ...
DESCRIPTION
chown changes the owner of the files to owner. The owner can be either a decimal user ID or a login name found in the password file.
chgrp changes the group ID of the files to group. The group can be either a decimal group ID or a group name found in the group file.
In order to change the owner or group, you must own the file or have appropriate privileges. If either command is invoked on a regular file by other than the super-user, the set-user-ID and set-group-ID bits of the file 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(1M).
When using chown or chgrp on symbolic links, the owner or group of the symbolic link is changed.
Access Control Lists (ACLs)
Users can permit or deny specific individuals and groups to access a file by setting optional ACL entries in the file’s access control list (see acl(5)). When using chown in conjunction with ACLs, if the new owner and/or group of a file does not have an optional ACL entry corresponding to u.% and/or %.g in the file’s access control list, the file’s access permission bits remain unchanged. However, if the new owner and/or group is already designated by an optional ACL entry of u.% and/or %.g in the file’s ACL, chown sets the corresponding file access permission bits (and the corresponding base ACL entries) to the permissions contained in that entry.
Options
−R Recursively change the owner or group. For each file operand that names a directory, the owner or group of the directory and all files and subdirectories in the file hierarchy below it are changed.
EXTERNAL INFLUENCES
International Code Set Support
Single- and multi-byte character code sets are supported.
RETURN VALUE
Exit values are:
0 Successful completion.
>0 Error condition occured.
EXAMPLES
The following command changes the owner of the file jokes to sandi:
chown sandi jokes
To execute this command, you must be either the owner of jokes or a user who has appropriate privileges.
WARNINGS
Access Control Lists
Access control list descriptions in this entry apply only to standard HP-UX BLS operating systems. If HP-UX BLS software has been installed, access control lists are handled differently. Refer to HP-UX BLS documentation for information about access control lists in the HP-UX BLS environment.
FILES
/etc/group
/etc/passwd
SEE ALSO
chmod(1), setprivgrp(1M), chown(2), group(4), passwd(4), acl(5).
STANDARDS CONFORMANCE
chown: SVID2, XPG2, XPG3, proposed POSIX.2 FIPS (June 1990)
chgrp: SVID2, XPG2, XPG3, proposed POSIX.2 FIPS (June 1990)
Hewlett-Packard Company — HP-UX Release 8.05: June 1991