Commit | Line | Data |
---|---|---|
b42074ab | 1 | .\" Copyright (c) 1990, 1991 The Regents of the University of California. |
a7bd3fcd | 2 | .\" All rights reserved. |
15102292 | 3 | .\" |
a7bd3fcd KB |
4 | .\" %sccs.include.redist.man% |
5 | .\" | |
b42074ab | 6 | .\" @(#)chown.8 6.5 (Berkeley) %G% |
15102292 | 7 | .\" |
b42074ab CL |
8 | .Dd |
9 | .Dt CHOWN 8 | |
10 | .Os BSD 4 | |
11 | .Sh NAME | |
12 | .Nm chown | |
13 | .Nd change file owner and group | |
14 | .Sh SYNOPSIS | |
15 | .Nm chown | |
16 | .Op Fl Rf | |
17 | .Op Ar owner | |
18 | .Op Ar group | |
19 | .Ar file ... | |
20 | .Sh DESCRIPTION | |
21 | .Nm Chown | |
a7bd3fcd | 22 | sets the user ID and/or the group ID of the specified files. |
b42074ab | 23 | .Pp |
a7bd3fcd | 24 | The options are as follows: |
b42074ab CL |
25 | .Bl -tag -width Ds |
26 | .It Fl R | |
a7bd3fcd KB |
27 | Change the user ID and/or the group ID for the file hierarchies rooted |
28 | in the files instead of just the files themselves. | |
b42074ab | 29 | .It Fl f |
a7bd3fcd KB |
30 | Don't report any failure to change file owner or group, nor modify |
31 | the exit status to reflect such failures. | |
b42074ab CL |
32 | .El |
33 | .Pp | |
a7bd3fcd | 34 | The |
b42074ab | 35 | .Ar owner |
a7bd3fcd | 36 | and |
b42074ab | 37 | .Ar group |
a7bd3fcd KB |
38 | operands are both optional, but at least one must be specified; if |
39 | the group operand is specified, it must be preceded by a colon (``:'') | |
40 | character. | |
b42074ab | 41 | .Pp |
a7bd3fcd | 42 | The |
b42074ab CL |
43 | .Ar owner |
44 | may be either a numeric user ID or a user name. | |
a7bd3fcd KB |
45 | If a user name is also a numeric user ID, the operand is used as a |
46 | user name. | |
47 | The | |
b42074ab CL |
48 | .Ar group |
49 | may be either a numeric group ID or a group name. | |
a7bd3fcd KB |
50 | If a group name is also a numeric group ID, the operand is used as a |
51 | group name. | |
b42074ab CL |
52 | .Pp |
53 | The ownership of a file may only be altered by a super-user for | |
54 | obvious security reasons. | |
55 | .Pp | |
a7bd3fcd KB |
56 | The owner and group of symbolic links are themselves changed instead |
57 | of the file to which the link points. | |
b42074ab | 58 | .Pp |
a7bd3fcd | 59 | The |
b42074ab | 60 | .Nm chown |
a7bd3fcd | 61 | utility exits 0 on success, and >0 if an error occurs. |
b42074ab | 62 | .Sh COMPATIBILITY |
a7bd3fcd | 63 | Previous versions of the |
b42074ab | 64 | .Nm chown |
a7bd3fcd KB |
65 | utility used the dot (``.'') character to distinguish the group name. |
66 | This has been changed to be a colon (``:'') character so that user and | |
67 | group names may contain the dot character. | |
b42074ab CL |
68 | .Sh SEE ALSO |
69 | .Xr chgrp 1 , | |
70 | .Xr find 1 , | |
71 | .Xr chown 2 | |
72 | .Sh STANDARDS | |
73 | The | |
74 | .Nm chown | |
75 | command is expected to be POSIX 1003.2 compliant. |