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 | .\" | |
ca414e03 | 6 | .\" @(#)chown.8 6.6 (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 | |
ca414e03 KB |
17 | .Ar owner Op Ar :group |
18 | .Ar file ... | |
19 | .Nm chown | |
20 | .Op Fl Rf | |
21 | .Ar :group | |
b42074ab CL |
22 | .Ar file ... |
23 | .Sh DESCRIPTION | |
24 | .Nm Chown | |
a7bd3fcd | 25 | sets the user ID and/or the group ID of the specified files. |
b42074ab | 26 | .Pp |
a7bd3fcd | 27 | The options are as follows: |
b42074ab CL |
28 | .Bl -tag -width Ds |
29 | .It Fl R | |
a7bd3fcd KB |
30 | Change the user ID and/or the group ID for the file hierarchies rooted |
31 | in the files instead of just the files themselves. | |
b42074ab | 32 | .It Fl f |
a7bd3fcd KB |
33 | Don't report any failure to change file owner or group, nor modify |
34 | the exit status to reflect such failures. | |
b42074ab CL |
35 | .El |
36 | .Pp | |
a7bd3fcd | 37 | The |
b42074ab | 38 | .Ar owner |
a7bd3fcd | 39 | and |
b42074ab | 40 | .Ar group |
ca414e03 KB |
41 | operands are both optional, however, one must be specified. |
42 | If the | |
43 | .Ar group | |
44 | operand is specified, it must be preceded by a colon (``:'') character. | |
b42074ab | 45 | .Pp |
a7bd3fcd | 46 | The |
b42074ab CL |
47 | .Ar owner |
48 | may be either a numeric user ID or a user name. | |
a7bd3fcd KB |
49 | If a user name is also a numeric user ID, the operand is used as a |
50 | user name. | |
51 | The | |
b42074ab CL |
52 | .Ar group |
53 | may be either a numeric group ID or a group name. | |
a7bd3fcd KB |
54 | If a group name is also a numeric group ID, the operand is used as a |
55 | group name. | |
b42074ab CL |
56 | .Pp |
57 | The ownership of a file may only be altered by a super-user for | |
58 | obvious security reasons. | |
59 | .Pp | |
a7bd3fcd KB |
60 | The owner and group of symbolic links are themselves changed instead |
61 | of the file to which the link points. | |
b42074ab | 62 | .Pp |
a7bd3fcd | 63 | The |
b42074ab | 64 | .Nm chown |
a7bd3fcd | 65 | utility exits 0 on success, and >0 if an error occurs. |
b42074ab | 66 | .Sh COMPATIBILITY |
a7bd3fcd | 67 | Previous versions of the |
b42074ab | 68 | .Nm chown |
a7bd3fcd KB |
69 | utility used the dot (``.'') character to distinguish the group name. |
70 | This has been changed to be a colon (``:'') character so that user and | |
71 | group names may contain the dot character. | |
b42074ab CL |
72 | .Sh SEE ALSO |
73 | .Xr chgrp 1 , | |
74 | .Xr find 1 , | |
75 | .Xr chown 2 | |
76 | .Sh STANDARDS | |
77 | The | |
78 | .Nm chown | |
79 | command is expected to be POSIX 1003.2 compliant. |