chown -- change file owner


/u95/bin/chown [-h] [-R] owner[:group]file ...


chown changes the owner of the files to owner. The value of owner may be either a decimal user ID or a login name found in the /etc/passwd file. Login names in /etc/passwd must begin with a non-numeric character; an alphabetic character or any special character except colon is acceptable. chown will optionally also change the group ID of the files to group. The value of group may be either a decimal group ID or a group name found in the group ID file /etc/group.

If chown is invoked by someone other than a privileged user, the set-user-ID and set-group ID bit of the file mode, 04000, is cleared.

Only the owner of a file (or a privileged user) may change the owner or group of that file.

Valid options to chown are:

Recursive. chown descends through the directory, and any subdirectories, setting the ownership (and group) ID as it proceeds. When symbolic links are encountered, they are traversed.

If the file is a symbolic link, change the owner (and group) of the symbolic link. Without this option, the owner (and group) of the file referenced by the symbolic link is changed. (See ``Notices'' below.)

The operating system has a configuration option {_POSIX_CHOWN_RESTRICTED}, to restrict ownership changes. When this option is in effect the owner of the file is prevented from changing the owner ID of the file, and may change the group of the file to a group to which the owner belongs. Only a privileged user can arbitrarily change owner (and group) IDs whether this option is in effect or not. When this option is in effect, only a privileged user can arbitrarily change group IDs.



language-specific message file (see LANG on environ(5)).


chgrp(1), chmod(1), chown(2), passwd(4)


chown(1) does not check the user ID if it is in decimal form; to check a user ID in this form, you can use chown(2).

Note that, with appropriate permissions, the owner of setuid files might inadvertantly be changed.

This command has been updated to handle files greater than 2GB.

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 02 June 2005