9103 opengroup acknowledgement should be properly formatted in man pages
[unleashed.git] / usr / src / man / man1 / chgrp.1
blob795bc56f66365db45df1de87e425bf8888771ffc
1 .\"
2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\"
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
9 .\" documentation.
10 .\"
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
13 .\"
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document.  The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
24 .\"
25 .\" This notice shall appear on any product containing this material.
26 .\"
27 .\" The Berkeley software License Agreement specifies the terms and conditions
28 .\" for redistribution.
29 .\"
30 .\" The contents of this file are subject to the terms of the
31 .\" Common Development and Distribution License (the "License").
32 .\" You may not use this file except in compliance with the License.
33 .\"
34 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
35 .\" or http://www.opensolaris.org/os/licensing.
36 .\" See the License for the specific language governing permissions
37 .\" and limitations under the License.
38 .\"
39 .\" When distributing Covered Code, include this CDDL HEADER in each
40 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
41 .\" If applicable, add the following below this CDDL HEADER, with the
42 .\" fields enclosed by brackets "[]" replaced with your own identifying
43 .\" information: Portions Copyright [yyyy] [name of copyright owner]
44 .\"
45 .\"
46 .\" Copyright (c) 1983 Regents of the University of California.
47 .\" All rights reserved.
48 .\" Copyright 1989 AT&T
49 .\" Portions Copyright (c) 1992, X/Open Company Limited  All Rights Reserved
50 .\" Copyright (c) 2003, Sun Microsystems, Inc.  All Rights Reserved
51 .\"
52 .TH CHGRP 1 "Jul 11, 2008"
53 .SH NAME
54 chgrp \- change file group ownership
55 .SH SYNOPSIS
56 .LP
57 .nf
58 \fBchgrp\fR [\fB-fhR\fR] \fIgroup\fR \fIfile\fR...
59 .fi
61 .LP
62 .nf
63 \fBchgrp\fR \fB-s\fR [\fB-fhR\fR] \fIgroupsid\fR \fIfile\fR...
64 .fi
66 .LP
67 .nf
68 \fBchgrp\fR \fB-R\fR [f] [\fB-H\fR | \fB-L\fR | \fB-P\fR] \fIgroup\fR \fIfile\fR...
69 .fi
71 .LP
72 .nf
73 \fBchgrp\fR \fB-s\fR \fB-R\fR [f] [\fB-H\fR | \fB-L\fR | \fB-P\fR] \fIgroupsid\fR \fIfile\fR...
74 .fi
76 .SH DESCRIPTION
77 .sp
78 .LP
79 The \fBchgrp\fR utility will set the group ID of the file named by each
80 \fIfile\fR operand to the group ID specified by the \fIgroup\fR operand.
81 .sp
82 .LP
83 For each \fIfile\fR operand, it will perform actions equivalent to the
84 \fBchown\fR(2) function, called with the following arguments:
85 .RS +4
86 .TP
87 .ie t \(bu
88 .el o
89 The \fIfile\fR operand will be used as the \fIpath\fR argument.
90 .RE
91 .RS +4
92 .TP
93 .ie t \(bu
94 .el o
95 The user ID of the file will be used as the \fIowner\fR argument.
96 .RE
97 .RS +4
98 .TP
99 .ie t \(bu
100 .el o
101 The specified group ID will be used as the \fIgroup\fR argument.
105 Unless \fBchgrp\fR is invoked by a process with appropriate privileges, the
106 set-user-ID and set-group-ID bits of a regular file will be cleared upon
107 successful completion; the set-user-ID and set-group-ID bits of other file
108 types may be cleared.
111 The operating system has a configuration option \fB_POSIX_CHOWN_RESTRICTED\fR,
112 to restrict ownership changes. When this option is in effect, the owner of the
113 file may change the group of the file only to a group to which the owner
114 belongs. Only the super-user can arbitrarily change owner IDs, whether or not
115 this option is in effect. To set this configuration option, include the
116 following line in \fB/etc/system\fR:
118 .in +2
120 set rstchown = 1
122 .in -2
126 To disable this option, include the following line in \fB/etc/system\fR:
128 .in +2
130 set rstchown = 0
132 .in -2
136 \fB_POSIX_CHOWN_RESTRICTED\fR is enabled by default. See \fBsystem\fR(4) and
137 \fBfpathconf\fR(2).
138 .SH OPTIONS
141 The following options are supported.
142 .SS "/usr/bin/chgrp and /usr/xpg4/bin/chgrp"
144 .ne 2
146 \fB\fB-f\fR\fR
148 .RS 6n
149 Force. Does not report errors.
153 .ne 2
155 \fB\fB-h\fR\fR
157 .RS 6n
158 If the file is a symbolic link, this option changes the group of the symbolic
159 link. Without this option, the group of the file referenced by the symbolic
160 link is changed.
164 .ne 2
166 \fB\fB-H\fR\fR
168 .RS 6n
169 If the file specified on the command line is a symbolic link referencing a file
170 of type directory, this option changes the group of the directory referenced by
171 the symbolic link and all the files in the file hierarchy below it. If a
172 symbolic link is encountered when traversing a file hierarchy, the group of the
173 target file is changed, but no recursion takes place.
177 .ne 2
179 \fB\fB-L\fR\fR
181 .RS 6n
182 If the file is a symbolic link, this option changes the group of the file
183 referenced by the symbolic link. If the file specified on the command line, or
184 encountered during the traversal of the file hierarchy, is a symbolic link
185 referencing a file of type directory, then this option changes the group of the
186 directory referenced by the symbolic link and all files in the file hierarchy
187 below it.
191 .ne 2
193 \fB\fB-P\fR\fR
195 .RS 6n
196 If the file specified on the command line or encountered during the traversal
197 of a file hierarchy is a symbolic link, this option changes the group of the
198 symbolic link. This option does not follow the symbolic link to any other part
199 of the file hierarchy.
203 .ne 2
205 \fB\fB-s\fR\fR
207 .RS 6n
208 The specified group is Windows SID. This option requires a file system that
209 supports storing SIDs, such as ZFS.
214 Specifying more than one of the mutually-exclusive options \fB-H\fR, \fB-L\fR,
215 or \fB-P\fR is not considered an error. The last option specified determines
216 the behavior of \fBchgrp\fR.
217 .SS "/usr/bin/chgrp"
219 .ne 2
221 \fB\fB-R\fR\fR
223 .RS 6n
224 Recursive. \fBchgrp\fR descends through the directory, and any subdirectories,
225 setting the specified group \fBID\fR as it proceeds. When a symbolic link is
226 encountered, the group of the target file is changed, unless the \fB-h\fR or
227 \fB-P\fR option is specified. However, no recursion takes place, unless the
228 \fB-H\fR or \fB-L\fR option is specified.
231 .SS "/usr/xpg4/bin/chgrp"
233 .ne 2
235 \fB\fB-R\fR\fR
237 .RS 6n
238 Recursive. \fBchgrp\fR descends through the directory, and any subdirectories,
239 setting the specified group \fBID\fR as it proceeds. When a symbolic link is
240 encountered, the group of the target file is changed, unless the \fB-h\fR or
241 \fB-P\fR option is specified. Unless the \fB-H\fR, \fB-L\fR, or \fB-P\fR option
242 is specified, the \fB-L\fR option is used as the default mode.
245 .SH OPERANDS
248 The following operands are supported:
250 .ne 2
252 \fB\fIgroup\fR\fR
254 .RS 9n
255 A group name from the group database or a numeric group ID. Either specifies a
256 group ID to be given to each file named by one of the \fIfile\fR operands. If a
257 numeric \fIgroup\fR operand exists in the group database as a group name, the
258 group ID number associated with that group name is used as the group ID.
262 .ne 2
264 \fB\fIfile\fR\fR
266 .RS 9n
267 A path name of a file whose group ID is to be modified.
270 .SH USAGE
273 See \fBlargefile\fR(5) for the description of the behavior of \fBchgrp\fR when
274 encountering files greater than or equal to 2 Gbyte (2^31 bytes).
275 .SH ENVIRONMENT VARIABLES
278 See \fBenviron\fR(5) for descriptions of the following environment variables
279 that affect the execution of \fBchgrp\fR: \fBLANG\fR, \fBLC_ALL\fR,
280 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
281 .SH EXIT STATUS
284 The following exit values are returned:
286 .ne 2
288 \fB\fB0\fR\fR
290 .RS 6n
291 The utility executed successfully and all requested changes were made.
295 .ne 2
297 \fB\fB>0\fR\fR
299 .RS 6n
300 An error occurred.
303 .SH FILES
305 .ne 2
307 \fB\fB/etc/group\fR\fR
309 .RS 14n
310 group file
313 .SH ATTRIBUTES
316 See \fBattributes\fR(5) for descriptions of the following attributes:
317 .SS "/usr/bin/chgrp"
322 box;
323 c | c
324 l | l .
325 ATTRIBUTE TYPE  ATTRIBUTE VALUE
327 CSI     Enabled. See NOTES.
329 Interface Stability     Committed
331 Standard        See \fBstandards\fR(5).
334 .SS "/usr/xpg4/bin/chgrp"
339 box;
340 c | c
341 l | l .
342 ATTRIBUTE TYPE  ATTRIBUTE VALUE
344 CSI     Enabled. See NOTES.
346 Interface Stability     Committed
348 Standard        See \fBstandards\fR(5).
351 .SH SEE ALSO
354 \fBchmod\fR(1), \fBchown\fR(1), \fBid\fR(1M), \fBchown\fR(2),
355 \fBfpathconf\fR(2), \fBgroup\fR(4), \fBpasswd\fR(4), \fBsystem\fR(4),
356 \fBattributes\fR(5), \fBenviron\fR(5), \fBlargefile\fR(5), \fBstandards\fR(5)
357 .SH NOTES
360 \fBchgrp\fR is CSI-enabled except for the \fIgroup\fR name.