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