chown

NAME

chown - change file owner and group

SYNOPSIS

chown [-fhR] [owner][:group] file ...

DESCRIPTION

The chown(1) command sets the user identifier (ID) and/or the group ID of the specified files. If file is a symbolic link, the user ID and/or the group ID of the file referenced by the symbolic link is changed unless the -h option is used.

OPTIONS

-f
Suppress error messages on files where the ownership could not be changed
-h
If file is a symbolic link, change the user ID and/or the group ID of the symbolic link.
-R
Change the user ID and/or the group ID for the file hierarchies rooted in the files instead of just the files themselves.

The owner and group operands are both optional; however, one must be specified. If the group operand is specified, it must be preceded by a colon (:).

The owner can be specified by either a numeric user ID or a user name. If a user name is also a numeric user ID, the operand is used as a user name. The group can be either a numeric group ID or a group name. If a group name is also a numeric group ID, the operand is used as a group name.

For security reasons, the ownership of a file can be altered only by a process with appropriate privileges.

DIAGNOSTICS

The chown(1) utility exits 0 on success, and >0 if an error occurs.

SEE ALSO

chgrp(1)