chown

From NetBSD Wiki

Jump to: navigation, search

The chown(8) command changes the owner of a file or directory.

Example:

$ ls -l force
-rw-rw-r--  1 yoda   jedi     0 Jan 1 10:10 force
$ chown luke force
$ ls -l force
-rw-rw-r--  1 luke   jedi     0 Jan 1 10:10 force

You can also change the group ownership of a file with chmod (or with chgrp):

$ chown luke:rebels force
$ ls -l force
-rw-rw-r--  1 luke   rebels  0 Jan 1 10:10 force

The above changes both the owner and the group. If you wish to change only the group, omit the owner:

$ chown :rebels force

For backwards-compatibility the owner.group notation is also possible instead of owner:group, but don't rely on it.

You can use the -R flag to recursively change all files under a particular directory.

See also

View source code (Please report any bugs or suggestions here).

Retrieved from "http://wiki.netbsd.se/chown"
Personal tools