chown

For the surname, see Chown (surname).

The chown command (abbreviation for change owner) is used on Unix-like systems to change the owner of a file system object (files and directories). Unprivileged (regular) users who wish to change the group of a file that they own may use chgrp.

From the BSD man page for chown:

For obvious security reasons, the ownership of a file may only be altered by a super-user. Similarly, only a member of a group can change a file's group ID to that group.[1]

Usage examples

These examples illustrate typical syntax and use. Modifying permissions requires you are either root or own a file. Changing owner requires root privilege.

 $ chown root /var/run/httpd.pid
 $ chown rob:developers strace.log
 $ chown nobody:nogroup /tmp /var/tmp
 $ chown :512 /home
 $ chown -R foouser base
 $ chown -R newuser:newgroup .

References

See also

External links

This article is issued from Wikipedia - version of the Monday, April 25, 2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.