add confSORT_QUEUE_BY_HOST and confBROKEN_SMTP_PEERS
[unix-history] / usr / src / usr.sbin / chown / chown.8
CommitLineData
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 33sets the user ID and/or the group ID of the specified files.
b42074ab 34.Pp
a7bd3fcd 35The options are as follows:
b42074ab 36.Bl -tag -width Ds
0daef752 37.It Fl H
c6bbda50
KB
38If the
39.Fl R
40option 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
43If the
44.Fl R
45option is specified, all symbolic links are followed.
46.It Fl P
47If the
48.Fl R
49option is specified, no symbolic links are followed.
b42074ab 50.It Fl R
a7bd3fcd
KB
51Change the user ID and/or the group ID for the file hierarchies rooted
52in the files instead of just the files themselves.
b42074ab 53.It Fl f
a7bd3fcd
KB
54Don't report any failure to change file owner or group, nor modify
55the exit status to reflect such failures.
b42074ab
CL
56.El
57.Pp
c6bbda50
KB
58Symbolic links don't have owners, so unless the
59.Fl H
0daef752 60or
c6bbda50
KB
61.Fl L
62option is set,
0daef752 63.Nm chown
8fbabe2e 64on a symbolic link always succeeds and has no effect.
c6bbda50
KB
65The
66.Fl H ,
67.Fl L
68and
69.Fl P
70options are ignored unless the
71.Fl R
72option is specified.
73In addition, these options override each other and the
74command's actions are determined by the last one specified.
0daef752 75.Pp
a7bd3fcd 76The
b42074ab 77.Ar owner
a7bd3fcd 78and
b42074ab 79.Ar group
ca414e03
KB
80operands are both optional, however, one must be specified.
81If the
82.Ar group
83operand is specified, it must be preceded by a colon (``:'') character.
b42074ab 84.Pp
a7bd3fcd 85The
b42074ab
CL
86.Ar owner
87may be either a numeric user ID or a user name.
a7bd3fcd
KB
88If a user name is also a numeric user ID, the operand is used as a
89user name.
90The
b42074ab
CL
91.Ar group
92may be either a numeric group ID or a group name.
a7bd3fcd
KB
93If a group name is also a numeric group ID, the operand is used as a
94group name.
b42074ab
CL
95.Pp
96The ownership of a file may only be altered by a super-user for
97obvious security reasons.
98.Pp
a7bd3fcd 99The
b42074ab 100.Nm chown
a7bd3fcd 101utility exits 0 on success, and >0 if an error occurs.
b42074ab 102.Sh COMPATIBILITY
a7bd3fcd 103Previous versions of the
b42074ab 104.Nm chown
a7bd3fcd
KB
105utility used the dot (``.'') character to distinguish the group name.
106This has been changed to be a colon (``:'') character so that user and
107group names may contain the dot character.
c6bbda50
KB
108.Pp
109Previous versions of the
110.Nm chown
111utility changed the owner of symbolic links specified on the command
112line.
113In 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
121The
122.Nm chown
123command is expected to be POSIX 1003.2 compliant.