386BSD 0.1 development
[unix-history] / usr / src / usr.sbin / chown / chgrp.1
CommitLineData
91b67a85
WJ
1.\" Copyright (c) 1983, 1990 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" the Institute of Electrical and Electronics Engineers, Inc.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\" notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\" notice, this list of conditions and the following disclaimer in the
14.\" documentation and/or other materials provided with the distribution.
15.\" 3. All advertising materials mentioning features or use of this software
16.\" must display the following acknowledgement:
17.\" This product includes software developed by the University of
18.\" California, Berkeley and its contributors.
19.\" 4. Neither the name of the University nor the names of its contributors
20.\" may be used to endorse or promote products derived from this software
21.\" without specific prior written permission.
22.\"
23.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33.\" SUCH DAMAGE.
34.\"
35.\" @(#)chgrp.1 6.7 (Berkeley) 6/27/91
36.\"
37.Dd June 27, 1991
38.Dt CHGRP 1
39.Os BSD 4.2
40.Sh NAME
41.Nm chgrp
42.Nd change group
43.Sh SYNOPSIS
44.Nm chgrp
45.Op Fl Rf
46.Ar group
47.Ar files ...
48.Sh DESCRIPTION
49The chgrp utility sets the group ID of the file named by each
50.Ar file
51operand to the
52.Ar group
53ID specified by the group operand.
54.Pp
55Options:
56.Bl -tag -width Ds
57.It Fl R
58Recursively change file group IDs.
59For each
60.Ar file
61operand that names a directory, chgrp changes the
62group of the directory and all files in the file
63hierarchy below it.
64When symbolic links are encountered, their group is changed,
65but they are not traversed.
66.It Fl f
67The force option ignores errors, except for usage errors and doesn't
68query about strange modes (unless user does not have proper permissions).
69.El
70.Pp
71Operands:
72.Bl -tag -width group
73.It Ar group
74The
75.Ar group
76can be either a group name from the group database, or a numeric
77group ID.
78.It Ar file
79A pathname of a file whose group ID is to be modified.
80.El
81.Pp
82The user invoking
83must belong
84to the specified group and be the owner of the file, or be the super-user.
85.Pp
86The
87.Nm chgrp
88utility exits 0 on success, and >0 if an error occurs.
89.Sh FILES
90.Bl -tag -width /etc/group -compact
91.It Pa /etc/group
92Group ID file
93.El
94.Sh SEE ALSO
95.Xr chown 2 ,
96.Xr chown 8 ,
97.Xr group 5 ,
98.Xr passwd 5
99.Sh STANDARDS
100The
101.Nm chgrp
102function is expected to be POSIX 1003.2 compatible.
103This manual page is derived from the POSIX 1003.2 manual page.