chown is a Unix command used to change the recorded owner of a computer file. The name is an acronym for Change Ownership. In short, it marks a file as being owned by someone else. The utility is useful because most Unix machines are multiuser, designed with the idea that multiple people will have access to the same environment. Ownership is a fundamental component of unix security.
Example
If you wanted to change ownership (to 'user' in group 'admins') of a specific directory (foo) you would type the command:
When a symbolic link is encountered and you have not specified the -h flag, the chown command changes the ownership of the file or directory pointed to by the link and not the ownership of the link itself.
If you specify both the -h flag and the -R flag, the chown command descends the specified directories recursively, and when a symbolic link is encountered, the ownership of the link itself is changed and not that of the file or directory pointed to by the link.
If the chown, chownx, fchown, fchownx, or lchown subroutine is unsuccessful, a value of -1 is returned and the errno global variable is set to indicate the error.
The second form changes the ownership of the indicated attribute on
You may @chown unlocked attributes on objects that you own to yourself, and you may also @chown attributes that you own on objects owned by others to the owner of the object.
When an object is @chowned, all unlocked attributes on the object are automatically @chowned as well, locked attributes remain owned by their original owners.