grammer nits
[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.\"
76229015 6.\" @(#)chown.8 6.11 (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
d109ab63 16.Op Fl HRfh
ca414e03
KB
17.Ar owner Op Ar :group
18.Ar file ...
19.Nm chown
0daef752 20.Op Fl HRfh
ca414e03 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 28.Bl -tag -width Ds
0daef752
EA
29.It Fl H
30When encountering a symbolic link on the command line, follow it. All other
31symbolic links encountered in the traversal are not followed.
b42074ab 32.It Fl R
a7bd3fcd
KB
33Change the user ID and/or the group ID for the file hierarchies rooted
34in the files instead of just the files themselves.
b42074ab 35.It Fl f
a7bd3fcd
KB
36Don't report any failure to change file owner or group, nor modify
37the exit status to reflect such failures.
0daef752 38.It Fl h
d109ab63 39When encountering a symbolic link anywhere in the traversal, follow it.
b42074ab
CL
40.El
41.Pp
76229015 42The ownership of a symbolic link is immutable, so unless the
0daef752
EA
43.Fl h
44or
45.Fl H
76229015 46flag is set,
0daef752 47.Nm chown
d109ab63 48on a symbolic link is a no-op.
0daef752 49.Pp
a7bd3fcd 50The
b42074ab 51.Ar owner
a7bd3fcd 52and
b42074ab 53.Ar group
ca414e03
KB
54operands are both optional, however, one must be specified.
55If the
56.Ar group
57operand is specified, it must be preceded by a colon (``:'') character.
b42074ab 58.Pp
a7bd3fcd 59The
b42074ab
CL
60.Ar owner
61may be either a numeric user ID or a user name.
a7bd3fcd
KB
62If a user name is also a numeric user ID, the operand is used as a
63user name.
64The
b42074ab
CL
65.Ar group
66may be either a numeric group ID or a group name.
a7bd3fcd
KB
67If a group name is also a numeric group ID, the operand is used as a
68group name.
b42074ab
CL
69.Pp
70The ownership of a file may only be altered by a super-user for
71obvious security reasons.
72.Pp
a7bd3fcd 73The
b42074ab 74.Nm chown
a7bd3fcd 75utility exits 0 on success, and >0 if an error occurs.
b42074ab 76.Sh COMPATIBILITY
a7bd3fcd 77Previous versions of the
b42074ab 78.Nm chown
a7bd3fcd
KB
79utility used the dot (``.'') character to distinguish the group name.
80This has been changed to be a colon (``:'') character so that user and
81group names may contain the dot character.
b42074ab
CL
82.Sh SEE ALSO
83.Xr chgrp 1 ,
84.Xr find 1 ,
0daef752 85.Xr chown 2 ,
0d17b9a2
KB
86.Xr fts 3 ,
87.Xr symlink 7
b42074ab
CL
88.Sh STANDARDS
89The
90.Nm chown
91command is expected to be POSIX 1003.2 compliant.