fe2181dae62e430d9c2fa1b54a942c9c8869ec2e
[dragonfly.git] / usr.sbin / chown / chgrp.1
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: src/usr.sbin/chown/chgrp.1,v 1.9.2.3 2001/08/16 15:55:44 ru Exp $
37 .\" $DragonFly: src/usr.sbin/chown/chgrp.1,v 1.7 2006/02/17 19:40:13 swildner Exp $
38 .\"
39 .Dd March 31, 1994
40 .Dt CHGRP 1
41 .Os
42 .Sh NAME
43 .Nm chgrp
44 .Nd change group
45 .Sh SYNOPSIS
46 .Nm
47 .Op Fl fhvR
48 .Ar group
49 .Ar
50 .Nm
51 .Op Fl fv
52 .Oo
53 .Fl R
54 .Op Fl H | Fl L | Fl P
55 .Oc
56 .Ar group
57 .Ar
58 .Sh DESCRIPTION
59 The
60 .Nm
61 utility sets the group ID of the file named by each
62 .Ar file
63 operand to the
64 .Ar group
65 ID specified by the group operand.
66 .Pp
67 The following options are available:
68 .Bl -tag -width indent
69 .It Fl H
70 If the
71 .Fl R
72 option is specified, symbolic links on the command line are followed.
73 (Symbolic links encountered in the tree traversal are not followed).
74 .It Fl L
75 If the
76 .Fl R
77 option is specified, all symbolic links are followed.
78 .It Fl P
79 If the
80 .Fl R
81 option is specified, no symbolic links are followed.
82 This is the default.
83 .It Fl R
84 Recursively change file group IDs.
85 For each
86 .Ar file
87 operand that names a directory,
88 .Nm
89 shall change the group of the directory
90 and all files in the file hierarchy below it.
91 .It Fl f
92 The force option ignores errors, except for usage errors and doesn't
93 query about strange modes (unless the user does not have proper permissions).
94 .It Fl h
95 If the file is a symbolic link, the group ID of the link itself is changed
96 rather than the file that is pointed to.
97 .It Fl v
98 Cause
99 .Nm
100 to be verbose, showing files as the group is modified.
101 .El
102 .Pp
103 The
104 .Fl H ,
105 .Fl L
106 and
107 .Fl P
108 options are ignored unless the
109 .Fl R
110 option is specified.
111 In addition, these options override each other and the
112 command's actions are determined by the last one specified.
113 .Pp
114 The
115 .Ar group
116 operand can be either a group name from the group database,
117 or a numeric group ID.
118 If a group name is also a numeric group ID, the operand is used as a
119 group name.
120 .Pp
121 The user invoking
122 .Nm
123 must belong to the specified group and be the owner of the file,
124 or be the super-user.
125 .Sh FILES
126 .Bl -tag -width /etc/group -compact
127 .It Pa /etc/group
128 group ID file
129 .El
130 .Sh DIAGNOSTICS
131 .Ex -std
132 .Sh COMPATIBILITY
133 In previous versions of this system, symbolic links did not have groups.
134 .Pp
135 The
136 .Fl f
137 and
138 .Fl v
139 options are extensions to the standard.
140 .Sh SEE ALSO
141 .Xr chown 2 ,
142 .Xr fts 3 ,
143 .Xr group 5 ,
144 .Xr passwd 5 ,
145 .Xr symlink 7 ,
146 .Xr chown 8
147 .Sh STANDARDS
148 The
149 .Nm
150 utility conforms to
151 .St -p1003.2
152 and
153 .St -p1003.1-2004 .