xref: /freebsd/usr.sbin/chown/chgrp.1 (revision 70423e21c8c1a7852c8fe4be892b6bef2f0af98e)
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.Ar group
53.Ar
54.Sh DESCRIPTION
55The
56.Nm
57utility sets the group ID of the file named by each
58.Ar file
59operand to the
60.Ar group
61ID specified by the group operand.
62.Pp
63The following options are available:
64.Bl -tag -width indent
65.It Fl H
66If the
67.Fl R
68option is specified, symbolic links on the command line are followed.
69(Symbolic links encountered in the tree traversal are not followed).
70.It Fl L
71If the
72.Fl R
73option is specified, all symbolic links are followed.
74.It Fl P
75If the
76.Fl R
77option is specified, no symbolic links are followed.
78.It Fl R
79Change the group ID for the file hierarchies rooted
80in the files instead of just the files themselves.
81.It Fl f
82The force option ignores errors, except for usage errors and doesn't
83query about strange modes (unless the user does not have proper permissions).
84.It Fl h
85If the file is a symbolic link, the group ID of the link itself is changed
86rather than the file that is pointed to.
87.El
88.Pp
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
109must belong to the specified group and be the owner of the file,
110or be the super-user.
111.Sh DIAGNOSTICS
112The
113.Nm
114utility exits 0 on success, and >0 if an error occurs.
115.Sh COMPATIBILITY
116In previous versions of this system, symbolic links did not have groups.
117.Sh FILES
118.Bl -tag -width /etc/group -compact
119.It Pa /etc/group
120group ID file
121.El
122.Sh SEE ALSO
123.Xr chown 2 ,
124.Xr fts 3 ,
125.Xr group 5 ,
126.Xr passwd 5 ,
127.Xr symlink 7 ,
128.Xr chown 8
129.Sh STANDARDS
130The
131.Nm
132utility is expected to be
133.St -p1003.2
134compatible.
135