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