xref: /freebsd/usr.sbin/chown/chgrp.1 (revision 4a0f765fbf09711e612e86fce8bb09ec43f482d9)
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.\"
37.Dd March 31, 1994
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.Oo
46.Fl R
47.Op Fl H | Fl L | Fl P
48.Oc
49.Op Fl f
50.Ar group
51.Ar files ...
52.Sh DESCRIPTION
53The chgrp utility sets the group ID of the file named by each
54.Ar file
55operand to the
56.Ar group
57ID specified by the group operand.
58.Pp
59Options:
60.Bl -tag -width Ds
61.It Fl H
62If the
63.Fl R
64option is specified, symbolic links on the command line are followed.
65(Symbolic links encountered in the tree traversal are not followed.)
66.It Fl L
67If the
68.Fl R
69option is specified, all symbolic links are followed.
70.It Fl P
71If the
72.Fl R
73option is specified, no symbolic links are followed.
74.It Fl R
75Change the group ID for the file hierarchies rooted
76in the files instead of just the files themselves.
77.It Fl f
78The force option ignores errors, except for usage errors and doesn't
79query about strange modes (unless the user does not have proper permissions).
80.El
81.Pp
82Symbolic links don't have groups, so unless the
83.Fl H
84or
85.Fl L
86option is set,
87.Nm chgrp
88on a symbolic link always succeeds and has no effect.
89The
90.Fl H ,
91.Fl L
92and
93.Fl P
94options are ignored unless the
95.Fl R
96option is specified.
97In addition, these options override each other and the
98command's actions are determined by the last one specified.
99.Pp
100The
101.Ar group
102operand can be either a group name from the group database,
103or a numeric group ID.
104If a group name is also a numeric group ID, the operand is used as a
105group name.
106.Pp
107The user invoking
108.Nm chgrp
109must belong to the specified group and be the owner of the file,
110or be the super-user.
111.Pp
112The
113.Nm chgrp
114utility exits 0 on success, and >0 if an error occurs.
115.Sh COMPATIBILITY
116Previous versions of the
117.Nm chgrp
118utility changed the group of symbolic links specified on the command
119line.
120In this system, symbolic links do not have groups.
121.Sh FILES
122.Bl -tag -width /etc/group -compact
123.It Pa /etc/group
124Group ID file
125.El
126.Sh SEE ALSO
127.Xr chown 2 ,
128.Xr fts 3 ,
129.Xr group 5 ,
130.Xr passwd 5 ,
131.Xr symlink 7 ,
132.Xr chown 8
133.Sh STANDARDS
134The
135.Nm chgrp
136utility is expected to be POSIX 1003.2 compatible.
137