xref: /original-bsd/usr.sbin/chown/chown.8 (revision a6d4d8bb)
1.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)chown.8	6.6 (Berkeley) 06/17/91
7.\"
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.Ar owner Op Ar :group
18.Ar file ...
19.Nm chown
20.Op Fl Rf
21.Ar :group
22.Ar file ...
23.Sh DESCRIPTION
24.Nm Chown
25sets the user ID and/or the group ID of the specified files.
26.Pp
27The options are as follows:
28.Bl -tag -width Ds
29.It Fl R
30Change the user ID and/or the group ID for the file hierarchies rooted
31in the files instead of just the files themselves.
32.It Fl f
33Don't report any failure to change file owner or group, nor modify
34the exit status to reflect such failures.
35.El
36.Pp
37The
38.Ar owner
39and
40.Ar group
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.
45.Pp
46The
47.Ar owner
48may be either a numeric user ID or a user name.
49If a user name is also a numeric user ID, the operand is used as a
50user name.
51The
52.Ar group
53may be either a numeric group ID or a group name.
54If a group name is also a numeric group ID, the operand is used as a
55group name.
56.Pp
57The ownership of a file may only be altered by a super-user for
58obvious security reasons.
59.Pp
60The owner and group of symbolic links are themselves changed instead
61of the file to which the link points.
62.Pp
63The
64.Nm chown
65utility exits 0 on success, and >0 if an error occurs.
66.Sh COMPATIBILITY
67Previous versions of the
68.Nm chown
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.
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.
80