Commit | Line | Data |
---|---|---|
c6bbda50 | 1 | .\" Copyright (c) 1990, 1991, 1993, 1994 |
4459015a | 2 | .\" The Regents of the University of California. All rights reserved. |
15102292 | 3 | .\" |
a7bd3fcd KB |
4 | .\" %sccs.include.redist.man% |
5 | .\" | |
8fbabe2e | 6 | .\" @(#)chown.8 8.3 (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 | |
c6bbda50 KB |
16 | .Oo |
17 | .Fl R | |
18 | .Op Fl H | Fl L | Fl P | |
19 | .Oc | |
20 | .Op Fl f | |
ca414e03 KB |
21 | .Ar owner Op Ar :group |
22 | .Ar file ... | |
23 | .Nm chown | |
c6bbda50 KB |
24 | .Oo |
25 | .Fl R | |
26 | .Op Fl H | Fl L | Fl P | |
27 | .Oc | |
28 | .Op Fl f | |
ca414e03 | 29 | .Ar :group |
b42074ab CL |
30 | .Ar file ... |
31 | .Sh DESCRIPTION | |
32 | .Nm Chown | |
a7bd3fcd | 33 | sets the user ID and/or the group ID of the specified files. |
b42074ab | 34 | .Pp |
a7bd3fcd | 35 | The options are as follows: |
b42074ab | 36 | .Bl -tag -width Ds |
0daef752 | 37 | .It Fl H |
c6bbda50 KB |
38 | If the |
39 | .Fl R | |
40 | option is specified, symbolic links on the command line are followed. | |
41 | (Symbolic links encountered in the tree traversal are not followed.) | |
42 | .It Fl L | |
43 | If the | |
44 | .Fl R | |
45 | option is specified, all symbolic links are followed. | |
46 | .It Fl P | |
47 | If the | |
48 | .Fl R | |
49 | option is specified, no symbolic links are followed. | |
b42074ab | 50 | .It Fl R |
a7bd3fcd KB |
51 | Change the user ID and/or the group ID for the file hierarchies rooted |
52 | in the files instead of just the files themselves. | |
b42074ab | 53 | .It Fl f |
a7bd3fcd KB |
54 | Don't report any failure to change file owner or group, nor modify |
55 | the exit status to reflect such failures. | |
b42074ab CL |
56 | .El |
57 | .Pp | |
c6bbda50 KB |
58 | Symbolic links don't have owners, so unless the |
59 | .Fl H | |
0daef752 | 60 | or |
c6bbda50 KB |
61 | .Fl L |
62 | option is set, | |
0daef752 | 63 | .Nm chown |
8fbabe2e | 64 | on a symbolic link always succeeds and has no effect. |
c6bbda50 KB |
65 | The |
66 | .Fl H , | |
67 | .Fl L | |
68 | and | |
69 | .Fl P | |
70 | options are ignored unless the | |
71 | .Fl R | |
72 | option is specified. | |
73 | In addition, these options override each other and the | |
74 | command's actions are determined by the last one specified. | |
0daef752 | 75 | .Pp |
a7bd3fcd | 76 | The |
b42074ab | 77 | .Ar owner |
a7bd3fcd | 78 | and |
b42074ab | 79 | .Ar group |
ca414e03 KB |
80 | operands are both optional, however, one must be specified. |
81 | If the | |
82 | .Ar group | |
83 | operand is specified, it must be preceded by a colon (``:'') character. | |
b42074ab | 84 | .Pp |
a7bd3fcd | 85 | The |
b42074ab CL |
86 | .Ar owner |
87 | may be either a numeric user ID or a user name. | |
a7bd3fcd KB |
88 | If a user name is also a numeric user ID, the operand is used as a |
89 | user name. | |
90 | The | |
b42074ab CL |
91 | .Ar group |
92 | may be either a numeric group ID or a group name. | |
a7bd3fcd KB |
93 | If a group name is also a numeric group ID, the operand is used as a |
94 | group name. | |
b42074ab CL |
95 | .Pp |
96 | The ownership of a file may only be altered by a super-user for | |
97 | obvious security reasons. | |
98 | .Pp | |
a7bd3fcd | 99 | The |
b42074ab | 100 | .Nm chown |
a7bd3fcd | 101 | utility exits 0 on success, and >0 if an error occurs. |
b42074ab | 102 | .Sh COMPATIBILITY |
a7bd3fcd | 103 | Previous versions of the |
b42074ab | 104 | .Nm chown |
a7bd3fcd KB |
105 | utility used the dot (``.'') character to distinguish the group name. |
106 | This has been changed to be a colon (``:'') character so that user and | |
107 | group names may contain the dot character. | |
c6bbda50 KB |
108 | .Pp |
109 | Previous versions of the | |
110 | .Nm chown | |
111 | utility changed the owner of symbolic links specified on the command | |
112 | line. | |
113 | In this system, symbolic links do not have owners. | |
b42074ab CL |
114 | .Sh SEE ALSO |
115 | .Xr chgrp 1 , | |
116 | .Xr find 1 , | |
0daef752 | 117 | .Xr chown 2 , |
0d17b9a2 KB |
118 | .Xr fts 3 , |
119 | .Xr symlink 7 | |
b42074ab CL |
120 | .Sh STANDARDS |
121 | The | |
122 | .Nm chown | |
123 | command is expected to be POSIX 1003.2 compliant. |