xref: /freebsd/usr.sbin/chown/chgrp.1 (revision 5bb83b98dbde8326de7b8221ef899ca38ddb3180)
1.\" Copyright (c) 1983, 1990, 1993, 1994
2.\"	The Regents of the University of California.  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	8.3 (Berkeley) 3/31/94
36.\" $FreeBSD$
37.\"
38.Dd March 31, 1994
39.Dt CHGRP 1
40.Os BSD 4.2
41.Sh NAME
42.Nm chgrp
43.Nd change group
44.Sh SYNOPSIS
45.Nm chgrp
46.Oo
47.Fl R
48.Op Fl H | Fl L | Fl P
49.Oc
50.Op Fl f
51.Op Fl h
52.Op Fl v
53.Ar group
54.Ar
55.Sh DESCRIPTION
56The
57.Nm
58utility sets the group ID of the file named by each
59.Ar file
60operand to the
61.Ar group
62ID specified by the group operand.
63.Pp
64The following options are available:
65.Bl -tag -width indent
66.It Fl H
67If the
68.Fl R
69option is specified, symbolic links on the command line are followed.
70(Symbolic links encountered in the tree traversal are not followed).
71.It Fl L
72If the
73.Fl R
74option is specified, all symbolic links are followed.
75.It Fl P
76If the
77.Fl R
78option is specified, no symbolic links are followed.
79.It Fl R
80Change the group ID for the file hierarchies rooted
81in the files instead of just the files themselves.
82.It Fl f
83The force option ignores errors, except for usage errors and doesn't
84query about strange modes (unless the user does not have proper permissions).
85.It Fl h
86If the file is a symbolic link, the group ID of the link itself is changed
87rather than the file that is pointed to.
88.It Fl v
89Cause
90.Nm
91to be verbose, showing files as the group is modified.
92.El
93.Pp
94The
95.Fl H ,
96.Fl L
97and
98.Fl P
99options are ignored unless the
100.Fl R
101option is specified.
102In addition, these options override each other and the
103command's actions are determined by the last one specified.
104.Pp
105The
106.Ar group
107operand can be either a group name from the group database,
108or a numeric group ID.
109If a group name is also a numeric group ID, the operand is used as a
110group name.
111.Pp
112The user invoking
113.Nm
114must belong to the specified group and be the owner of the file,
115or be the super-user.
116.Sh DIAGNOSTICS
117The
118.Nm
119utility exits 0 on success, and >0 if an error occurs.
120.Sh COMPATIBILITY
121In previous versions of this system, symbolic links did not have groups.
122.Pp
123The
124.Fl v
125option is non-standard and its use in scripts is not recommended.
126.Sh FILES
127.Bl -tag -width /etc/group -compact
128.It Pa /etc/group
129group ID file
130.El
131.Sh SEE ALSO
132.Xr chown 2 ,
133.Xr fts 3 ,
134.Xr group 5 ,
135.Xr passwd 5 ,
136.Xr symlink 7 ,
137.Xr chown 8
138.Sh STANDARDS
139The
140.Nm
141utility is expected to be
142.St -p1003.2
143compatible.
144