Un outil pour savoir si une commande est posix - retour accueil
git clone git://bebou.netlib.re/isposix
Log | Files | Refs | README |
chgrp.html (12984B)
1 <!-- Copyright 2001-2024 IEEE and The Open Group, All Rights Reserved --> 2 <!DOCTYPE HTML> 3 <html lang="en"> 4 <head> 5 <meta name="generator" content="HTML Tidy for HTML5 for Linux version 5.8.0"> 6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 7 <link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group rhtm tool v1.2.4 --> 8 <!-- Copyright (c) 2001-2024 The Open Group, All Rights Reserved --> 9 <title>chgrp</title> 10 </head> 11 <body bgcolor="white"> 12 <div class="NAVHEADER"> 13 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0"> 14 <tr class="nav"> 15 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/cflow.html" accesskey="P"><<< 16 Previous</a></td> 17 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td> 18 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/chmod.html" accesskey="N">Next 19 >>></a></td> 20 </tr> 21 </table> 22 <hr align="left" width="100%"></div> 23 <script language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> 24 <center><font size="2">The Open Group Base Specifications Issue 8<br> 25 IEEE Std 1003.1-2024<br> 26 Copyright © 2001-2024 The IEEE and The Open Group</font></center> 27 <hr size="2" noshade> 28 <a name="top" id="top"></a> <a name="chgrp" id="chgrp"></a> <a name="tag_20_16" id="tag_20_16"></a><!-- chgrp --> 29 <h4 class="mansect"><a name="tag_20_16_01" id="tag_20_16_01"></a>NAME</h4> 30 <blockquote>chgrp — change the file group ownership</blockquote> 31 <h4 class="mansect"><a name="tag_20_16_02" id="tag_20_16_02"></a>SYNOPSIS</h4> 32 <blockquote class="synopsis"> 33 <p><code><tt>chgrp</tt> <b>[</b><tt>-h</tt><b>]</b> <i>group file</i><tt>...<br> 34 <br> 35 chgrp -R</tt> <b>[</b><tt>-H|-L|-P</tt><b>]</b> <i>group file</i><tt>...<br></tt></code></p> 36 </blockquote> 37 <h4 class="mansect"><a name="tag_20_16_03" id="tag_20_16_03"></a>DESCRIPTION</h4> 38 <blockquote> 39 <p>The <i>chgrp</i> utility shall set the group ID of the file named by each <i>file</i> operand to the group ID specified by the 40 <i>group</i> operand.</p> 41 <p>For each <i>file</i> operand, or, if the <b>-R</b> option is used, each file encountered while walking the directory trees 42 specified by the <i>file</i> operands, the <i>chgrp</i> utility shall perform actions equivalent to the <a href= 43 "../functions/chown.html"><i>chown</i>()</a> function defined in the System Interfaces volume of POSIX.1-2024, called with the 44 following arguments:</p> 45 <ul> 46 <li> 47 <p>The <i>file</i> operand shall be used as the <i>path</i> argument.</p> 48 </li> 49 <li> 50 <p>The user ID of the file shall be used as the <i>owner</i> argument.</p> 51 </li> 52 <li> 53 <p>The specified group ID shall be used as the <i>group</i> argument.</p> 54 </li> 55 </ul> 56 <p>Unless <i>chgrp</i> is invoked by a process with appropriate privileges, the set-user-ID and set-group-ID bits of a regular file 57 shall be cleared upon successful completion; the set-user-ID and set-group-ID bits of other file types may be cleared.</p> 58 </blockquote> 59 <h4 class="mansect"><a name="tag_20_16_04" id="tag_20_16_04"></a>OPTIONS</h4> 60 <blockquote> 61 <p>The <i>chgrp</i> utility shall conform to XBD <a href="../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax 62 Guidelines</i></a> .</p> 63 <p>The following options shall be supported by the implementation:</p> 64 <dl compact> 65 <dd></dd> 66 <dt><b>-h</b></dt> 67 <dd>For each <i>file</i> operand that names a file of type symbolic link, <i>chgrp</i> shall attempt to set the group ID of the 68 symbolic link instead of the file referenced by the symbolic link.</dd> 69 <dt><b>-H</b></dt> 70 <dd>If the <b>-R</b> option is specified and a symbolic link referencing a file of type directory is specified on the command line, 71 <i>chgrp</i> shall change the group of the directory referenced by the symbolic link and all files in the file hierarchy below 72 it.</dd> 73 <dt><b>-L</b></dt> 74 <dd>If the <b>-R</b> option is specified and a symbolic link referencing a file of type directory is specified on the command line 75 or encountered during the traversal of a file hierarchy, <i>chgrp</i> shall change the group of the directory referenced by the 76 symbolic link and all files in the file hierarchy below it.</dd> 77 <dt><b>-P</b></dt> 78 <dd>If the <b>-R</b> option is specified and a symbolic link is specified on the command line or encountered during the traversal 79 of a file hierarchy, <i>chgrp</i> shall change the group ID of the symbolic link. The <i>chgrp</i> utility shall not follow the 80 symbolic link to any other part of the file hierarchy.</dd> 81 <dt><b>-R</b></dt> 82 <dd>Recursively change file group IDs. For each <i>file</i> operand that names a directory, <i>chgrp</i> shall change the group of 83 the directory and all files in the file hierarchy below it. Unless a <b>-H</b>, <b>-L</b>, or <b>-P</b> option is specified, it is 84 unspecified which of these options will be used as the default.</dd> 85 </dl> 86 <p>Specifying more than one of the mutually-exclusive options <b>-H</b>, <b>-L</b>, and <b>-P</b> shall not be considered an error. 87 The last option specified shall determine the behavior of the utility.</p> 88 </blockquote> 89 <h4 class="mansect"><a name="tag_20_16_05" id="tag_20_16_05"></a>OPERANDS</h4> 90 <blockquote> 91 <p>The following operands shall be supported:</p> 92 <dl compact> 93 <dd></dd> 94 <dt><i>group</i></dt> 95 <dd>A group name from the group database or a numeric group ID. Either specifies a group ID to be given to each file named by one 96 of the <i>file</i> operands. If a numeric <i>group</i> operand exists in the group database as a group name, the group ID number 97 associated with that group name is used as the group ID.</dd> 98 <dt><i>file</i></dt> 99 <dd>A pathname of a file whose group ID is to be modified.</dd> 100 </dl> 101 </blockquote> 102 <h4 class="mansect"><a name="tag_20_16_06" id="tag_20_16_06"></a>STDIN</h4> 103 <blockquote> 104 <p>Not used.</p> 105 </blockquote> 106 <h4 class="mansect"><a name="tag_20_16_07" id="tag_20_16_07"></a>INPUT FILES</h4> 107 <blockquote> 108 <p>None.</p> 109 </blockquote> 110 <h4 class="mansect"><a name="tag_20_16_08" id="tag_20_16_08"></a>ENVIRONMENT VARIABLES</h4> 111 <blockquote> 112 <p>The following environment variables shall affect the execution of <i>chgrp</i>:</p> 113 <dl compact> 114 <dd></dd> 115 <dt><i>LANG</i></dt> 116 <dd>Provide a default value for the internationalization variables that are unset or null. (See XBD <a href= 117 "../basedefs/V1_chap08.html#tag_08_02"><i>8.2 Internationalization Variables</i></a> for the precedence of internationalization 118 variables used to determine the values of locale categories.)</dd> 119 <dt><i>LC_ALL</i></dt> 120 <dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd> 121 <dt><i>LC_CTYPE</i></dt> 122 <dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as 123 opposed to multi-byte characters in arguments).</dd> 124 <dt><i>LC_MESSAGES</i></dt> 125 <dd><br> 126 Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.</dd> 127 <dt><i>NLSPATH</i></dt> 128 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> 129 Determine the location of messages objects and message catalogs. <img src="../images/opt-end.gif" alt="[Option End]" border= 130 "0"></dd> 131 </dl> 132 </blockquote> 133 <h4 class="mansect"><a name="tag_20_16_09" id="tag_20_16_09"></a>ASYNCHRONOUS EVENTS</h4> 134 <blockquote> 135 <p>Default.</p> 136 </blockquote> 137 <h4 class="mansect"><a name="tag_20_16_10" id="tag_20_16_10"></a>STDOUT</h4> 138 <blockquote> 139 <p>Not used.</p> 140 </blockquote> 141 <h4 class="mansect"><a name="tag_20_16_11" id="tag_20_16_11"></a>STDERR</h4> 142 <blockquote> 143 <p>The standard error shall be used only for diagnostic messages.</p> 144 </blockquote> 145 <h4 class="mansect"><a name="tag_20_16_12" id="tag_20_16_12"></a>OUTPUT FILES</h4> 146 <blockquote> 147 <p>None.</p> 148 </blockquote> 149 <h4 class="mansect"><a name="tag_20_16_13" id="tag_20_16_13"></a>EXTENDED DESCRIPTION</h4> 150 <blockquote> 151 <p>None.</p> 152 </blockquote> 153 <h4 class="mansect"><a name="tag_20_16_14" id="tag_20_16_14"></a>EXIT STATUS</h4> 154 <blockquote> 155 <p>The following exit values shall be returned:</p> 156 <dl compact> 157 <dd></dd> 158 <dt> 0</dt> 159 <dd>The utility executed successfully and all requested changes were made.</dd> 160 <dt>>0</dt> 161 <dd>An error occurred.</dd> 162 </dl> 163 </blockquote> 164 <h4 class="mansect"><a name="tag_20_16_15" id="tag_20_16_15"></a>CONSEQUENCES OF ERRORS</h4> 165 <blockquote> 166 <p>Default.</p> 167 </blockquote> 168 <hr> 169 <div class="box"><em>The following sections are informative.</em></div> 170 <h4 class="mansect"><a name="tag_20_16_16" id="tag_20_16_16"></a>APPLICATION USAGE</h4> 171 <blockquote> 172 <p>Only the owner of a file or the user with appropriate privileges may change the owner or group of a file.</p> 173 <p>Some implementations restrict the use of <i>chgrp</i> to a user with appropriate privileges when the <i>group</i> specified is 174 not the effective group ID or one of the supplementary group IDs of the calling process.</p> 175 </blockquote> 176 <h4 class="mansect"><a name="tag_20_16_17" id="tag_20_16_17"></a>EXAMPLES</h4> 177 <blockquote> 178 <p>None.</p> 179 </blockquote> 180 <h4 class="mansect"><a name="tag_20_16_18" id="tag_20_16_18"></a>RATIONALE</h4> 181 <blockquote> 182 <p>The System V and BSD versions use different exit status codes. Some implementations used the exit status as a count of the 183 number of errors that occurred; this practice is unworkable since it can overflow the range of valid exit status values. The 184 standard developers chose to mask these by specifying only 0 and >0 as exit values.</p> 185 <p>The functionality of <i>chgrp</i> is described substantially through references to <a href= 186 "../functions/chown.html"><i>chown</i>()</a>. In this way, there is no duplication of effort required for describing the 187 interactions of permissions, multiple groups, and so on.</p> 188 </blockquote> 189 <h4 class="mansect"><a name="tag_20_16_19" id="tag_20_16_19"></a>FUTURE DIRECTIONS</h4> 190 <blockquote> 191 <p>None.</p> 192 </blockquote> 193 <h4 class="mansect"><a name="tag_20_16_20" id="tag_20_16_20"></a>SEE ALSO</h4> 194 <blockquote> 195 <p><a href="../utilities/chmod.html#tag_20_17"><i>chmod</i></a> , <a href="../utilities/chown.html#tag_20_18"><i>chown</i></a></p> 196 <p>XBD <a href="../basedefs/V1_chap08.html#tag_08"><i>8. Environment Variables</i></a> , <a href= 197 "../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax Guidelines</i></a></p> 198 <p>XSH <a href="../functions/chown.html#tag_17_73"><i>chown</i></a></p> 199 </blockquote> 200 <h4 class="mansect"><a name="tag_20_16_21" id="tag_20_16_21"></a>CHANGE HISTORY</h4> 201 <blockquote> 202 <p>First released in Issue 2.</p> 203 </blockquote> 204 <h4 class="mansect"><a name="tag_20_16_22" id="tag_20_16_22"></a>Issue 6</h4> 205 <blockquote> 206 <p>New options <b>-H</b>, <b>-L</b>, and <b>-P</b> are added to align with the IEEE P1003.2b draft standard. These options 207 affect the processing of symbolic links.</p> 208 <p>IEEE PASC Interpretation 1003.2 #172 is applied, changing the CONSEQUENCES OF ERRORS section to "Default.".</p> 209 <p>IEEE Std 1003.1-2001/Cor 1-2002, item XCU/TC1/D6/15 is applied, changing the SYNOPSIS to make it clear that 210 <b>-h</b> and <b>-R</b> are optional.</p> 211 </blockquote> 212 <h4 class="mansect"><a name="tag_20_16_23" id="tag_20_16_23"></a>Issue 7</h4> 213 <blockquote> 214 <p>SD5-XCU-ERN-8 is applied, removing the <b>-R</b> from the first line of the SYNOPSIS.</p> 215 <p>SD5-XCU-ERN-97 is applied, updating the SYNOPSIS.</p> 216 <p>POSIX.1-2008, Technical Corrigendum 1, XCU/TC1-2008/0080 [237,341] is applied.</p> 217 </blockquote> 218 <h4 class="mansect"><a name="tag_20_16_24" id="tag_20_16_24"></a>Issue 8</h4> 219 <blockquote> 220 <p>Austin Group Defect 1122 is applied, changing the description of <i>NLSPATH .</i></p> 221 </blockquote> 222 <div class="box"><em>End of informative text.</em></div> 223 <hr> 224 <p> </p> 225 <a href="#top"><span class="topOfPage">return to top of page</span></a><br> 226 <hr size="2" noshade> 227 <center><font size="2">UNIX® is a registered Trademark of The Open Group.<br> 228 POSIX™ is a Trademark of The IEEE.<br> 229 Copyright © 2001-2024 The IEEE and The Open Group, All Rights Reserved<br> 230 [ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href= 231 "../functions/contents.html">XSH</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../xrat/contents.html">XRAT</a> 232 ]</font></center> 233 <hr size="2" noshade> 234 <div class="NAVHEADER"> 235 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0"> 236 <tr class="nav"> 237 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/cflow.html" accesskey="P"><<< 238 Previous</a></td> 239 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td> 240 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/chmod.html" accesskey="N">Next 241 >>></a></td> 242 </tr> 243 </table> 244 <hr align="left" width="100%"></div> 245 </body> 246 </html>