1.\"	$MirOS: src/bin/chmod/chgrp.1,v 1.2 2007/05/20 19:20:28 tg Exp $
2.\"	$OpenBSD: chgrp.1,v 1.6 2004/02/14 18:14:14 jmc Exp $
3.\"
4.\" Copyright (c) 1983, 1990, 1993, 1994
5.\"	The Regents of the University of California.  All rights reserved.
6.\"
7.\" This code is derived from software contributed to Berkeley by
8.\" the Institute of Electrical and Electronics Engineers, Inc.
9.\"
10.\" Redistribution and use in source and binary forms, with or without
11.\" modification, are permitted provided that the following conditions
12.\" are met:
13.\" 1. Redistributions of source code must retain the above copyright
14.\"    notice, this list of conditions and the following disclaimer.
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\"    notice, this list of conditions and the following disclaimer in the
17.\"    documentation and/or other materials provided with the distribution.
18.\" 3. Neither the name of the University nor the names of its contributors
19.\"    may be used to endorse or promote products derived from this software
20.\"    without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.\"     from: @(#)chgrp.1	8.3 (Berkeley) 3/31/94
35.\"
36.Dd May 20, 2007
37.Dt CHGRP 1
38.Os
39.Sh NAME
40.Nm chgrp
41.Nd change group
42.Sh SYNOPSIS
43.Nm chgrp
44.Oo
45.Fl R
46.Op Fl H | L | P
47.Oc
48.Op Fl fh
49.Ar group
50.Ar file Op Ar ...
51.Sh DESCRIPTION
52.Nm
53sets the group ID of the specified files.
54.Pp
55The options are as follows:
56.Bl -tag -width Ds
57.It Fl H
58If the
59.Fl R
60option is specified, symbolic links on the command line are followed.
61(Symbolic links encountered in the tree traversal are not followed.)
62.It Fl L
63If the
64.Fl R
65option is specified, all symbolic links are followed.
66.It Fl P
67If the
68.Fl R
69option is specified, no symbolic links are followed.
70.It Fl R
71Change the group ID for the file hierarchies rooted
72in the files instead of just the files themselves.
73.It Fl f
74The force option ignores errors, except for usage errors.
75.It Fl h
76Change the group ID of the specified symbolic link.
77The
78.Fl h
79and
80.Fl R
81options are mutually exclusive.
82.El
83.Pp
84The
85.Fl H ,
86.Fl L ,
87and
88.Fl P
89options are ignored unless the
90.Fl R
91option is specified.
92In addition, these options override each other and the
93command's actions are determined by the last one specified.
94.Pp
95The
96.Ar group
97operand can be either a group name from the group database,
98or a numeric group ID.
99If a group name is also a numeric group ID, the operand is used as a
100group name.
101.Pp
102The user invoking
103.Nm
104must belong to the specified group and be the owner of the file,
105or be the superuser.
106.Pp
107The
108.Nm
109utility exits 0 on success or >0 if an error occurred.
110.Sh FILES
111.Bl -tag -width /etc/group -compact
112.It Pa /etc/group
113group ID file
114.El
115.Sh SEE ALSO
116.Xr chown 2 ,
117.Xr lchown 2 ,
118.Xr fts 3 ,
119.Xr group 5 ,
120.Xr passwd 5 ,
121.Xr symlink 7 ,
122.Xr chown 8
123.Sh STANDARDS
124The
125.Nm
126utility is expected to be POSIX 1003.2 compatible.
127