This commit was generated by cvs2svn to track changes on a CVS vendor
[unix-history] / usr.sbin / chown / chown.8
CommitLineData
15637ed4
RG
1.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\" must display the following acknowledgement:
14.\" This product includes software developed by the University of
15.\" California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)chown.8 6.6 (Berkeley) 6/17/91
33.\"
34.Dd June 17, 1991
35.Dt CHOWN 8
36.Os BSD 4
37.Sh NAME
38.Nm chown
39.Nd change file owner and group
40.Sh SYNOPSIS
41.Nm chown
42.Op Fl Rf
43.Ar owner Op Ar :group
44.Ar file ...
45.Nm chown
46.Op Fl Rf
47.Ar :group
48.Ar file ...
49.Sh DESCRIPTION
50.Nm Chown
51sets the user ID and/or the group ID of the specified files.
52.Pp
53The options are as follows:
54.Bl -tag -width Ds
55.It Fl R
56Change the user ID and/or the group ID for the file hierarchies rooted
57in the files instead of just the files themselves.
58.It Fl f
59Don't report any failure to change file owner or group, nor modify
60the exit status to reflect such failures.
61.El
62.Pp
63The
64.Ar owner
65and
66.Ar group
67operands are both optional, however, one must be specified.
68If the
69.Ar group
70operand is specified, it must be preceded by a colon (``:'') character.
71.Pp
72The
73.Ar owner
74may be either a numeric user ID or a user name.
75If a user name is also a numeric user ID, the operand is used as a
76user name.
77The
78.Ar group
79may be either a numeric group ID or a group name.
80If a group name is also a numeric group ID, the operand is used as a
81group name.
82.Pp
83The ownership of a file may only be altered by a super-user for
84obvious security reasons.
85.Pp
86The owner and group of symbolic links are themselves changed instead
87of the file to which the link points.
88.Pp
89The
90.Nm chown
91utility exits 0 on success, and >0 if an error occurs.
92.Sh COMPATIBILITY
93Previous versions of the
94.Nm chown
95utility used the dot (``.'') character to distinguish the group name.
96This has been changed to be a colon (``:'') character so that user and
97group names may contain the dot character.
98.Sh SEE ALSO
99.Xr chgrp 1 ,
100.Xr find 1 ,
101.Xr chown 2
102.Sh STANDARDS
103The
104.Nm chown
105command is expected to be POSIX 1003.2 compliant.