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