chown

From Mac Guides

Jump to: navigation, search

chown is a Terminal program for changing file ownerships, in a similar manner found in Finder's Get Info window in the Ownership & Permission section. chown is equivalent to the "Owner" field, and in it's extended form, the Group field. (For completeness, the Access fields are equivalent to chmod)

chown is often executed via sudo.

Examples

To change ownership of a file to a user named "mark"

 chown mark somefile.txt

To change ownership and group of a file to a user named "mark" in a group "geniuses"

 chown mark:geniuses somefile.txt

Man Page Excerpt

The chown utility changes the user ID and/or the group ID of the specified files. Symbolic links named by arguments are silently left unchanged unless -h is used.