Move everything from /var/adm to /var/log
[unleashed.git] / share / man / man1 / chgrp.1
blob16ce2eb26ac7a46d8bab6b01be0727f648c7931c
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 "Oct 25, 2017"
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.
143 .ne 2
145 \fB\fB-f\fR\fR
147 .RS 6n
148 Force. Does not report errors.
152 .ne 2
154 \fB\fB-h\fR\fR
156 .RS 6n
157 If the file is a symbolic link, this option changes the group of the symbolic
158 link. Without this option, the group of the file referenced by the symbolic
159 link is changed.
163 .ne 2
165 \fB\fB-H\fR\fR
167 .RS 6n
168 If the file specified on the command line is a symbolic link referencing a file
169 of type directory, this option changes the group of the directory referenced by
170 the symbolic link and all the files in the file hierarchy below it. If a
171 symbolic link is encountered when traversing a file hierarchy, the group of the
172 target file is changed, but no recursion takes place.
176 .ne 2
178 \fB\fB-L\fR\fR
180 .RS 6n
181 If the file is a symbolic link, this option changes the group of the file
182 referenced by the symbolic link. If the file specified on the command line, or
183 encountered during the traversal of the file hierarchy, is a symbolic link
184 referencing a file of type directory, then this option changes the group of the
185 directory referenced by the symbolic link and all files in the file hierarchy
186 below it.
190 .ne 2
192 \fB\fB-P\fR\fR
194 .RS 6n
195 If the file specified on the command line or encountered during the traversal
196 of a file hierarchy is a symbolic link, this option changes the group of the
197 symbolic link. This option does not follow the symbolic link to any other part
198 of the file hierarchy.
202 .ne 2
204 \fB\fB-s\fR\fR
206 .RS 6n
207 The specified group is Windows SID. This option requires a file system that
208 supports storing SIDs, such as ZFS.
213 Specifying more than one of the mutually-exclusive options \fB-H\fR, \fB-L\fR,
214 or \fB-P\fR is not considered an error. The last option specified determines
215 the behavior of \fBchgrp\fR.
217 .ne 2
219 \fB\fB-R\fR\fR
221 .RS 6n
222 Recursive. \fBchgrp\fR descends through the directory, and any subdirectories,
223 setting the specified group \fBID\fR as it proceeds. When a symbolic link is
224 encountered, the group of the target file is changed, unless the \fB-h\fR or
225 \fB-P\fR option is specified. Unless the \fB-H\fR, \fB-L\fR, or \fB-P\fR option
226 is specified, the \fB-L\fR option is used as the default mode.
229 .SH OPERANDS
232 The following operands are supported:
234 .ne 2
236 \fB\fIgroup\fR\fR
238 .RS 9n
239 A group name from the group database or a numeric group ID. Either specifies a
240 group ID to be given to each file named by one of the \fIfile\fR operands. If a
241 numeric \fIgroup\fR operand exists in the group database as a group name, the
242 group ID number associated with that group name is used as the group ID.
246 .ne 2
248 \fB\fIfile\fR\fR
250 .RS 9n
251 A path name of a file whose group ID is to be modified.
254 .SH ENVIRONMENT VARIABLES
257 See \fBenviron\fR(5) for descriptions of the following environment variables
258 that affect the execution of \fBchgrp\fR: \fBLANG\fR, \fBLC_ALL\fR,
259 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
260 .SH EXIT STATUS
263 The following exit values are returned:
265 .ne 2
267 \fB\fB0\fR\fR
269 .RS 6n
270 The utility executed successfully and all requested changes were made.
274 .ne 2
276 \fB\fB>0\fR\fR
278 .RS 6n
279 An error occurred.
282 .SH FILES
284 .ne 2
286 \fB\fB/etc/group\fR\fR
288 .RS 14n
289 group file
292 .SH ATTRIBUTES
295 See \fBattributes\fR(5) for descriptions of the following attributes:
296 .SS "/usr/bin/chgrp"
301 box;
302 c | c
303 l | l .
304 ATTRIBUTE TYPE  ATTRIBUTE VALUE
306 CSI     Enabled. See NOTES.
308 Interface Stability     Committed
310 Standard        See \fBstandards\fR(5).
313 .SH SEE ALSO
316 \fBchmod\fR(1), \fBchown\fR(1), \fBid\fR(8), \fBchown\fR(2),
317 \fBfpathconf\fR(2), \fBgroup\fR(4), \fBpasswd\fR(4), \fBsystem\fR(4),
318 \fBattributes\fR(5), \fBenviron\fR(5), \fBstandards\fR(5)
319 .SH NOTES
322 \fBchgrp\fR is CSI-enabled except for the \fIgroup\fR name.