logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

chgrp.1p (7438B)


  1. '\" et
  2. .TH CHGRP "1P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. chgrp
  12. \(em change the file group ownership
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. chgrp \fB[\fR-h\fB] \fIgroup file\fR...
  17. .P
  18. chgrp -R \fB[\fR-H|-L|-P\fB] \fIgroup file\fR...
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. .IR chgrp
  23. utility shall set the group ID of the file named by each
  24. .IR file
  25. operand to the group ID specified by the
  26. .IR group
  27. operand.
  28. .P
  29. For each
  30. .IR file
  31. operand, or, if the
  32. .BR \-R
  33. option is used, each file encountered while walking the directory
  34. trees specified by the
  35. .IR file
  36. operands, the
  37. .IR chgrp
  38. utility shall perform actions equivalent to the
  39. \fIchown\fR()
  40. function defined in the System Interfaces volume of POSIX.1\(hy2017, called with the following arguments:
  41. .IP " *" 4
  42. The
  43. .IR file
  44. operand shall be used as the
  45. .IR path
  46. argument.
  47. .IP " *" 4
  48. The user ID of the file shall be used as the
  49. .IR owner
  50. argument.
  51. .IP " *" 4
  52. The specified group ID shall be used as the
  53. .IR group
  54. argument.
  55. .P
  56. Unless
  57. .IR chgrp
  58. is invoked by a process with appropriate privileges, the set-user-ID
  59. and set-group-ID bits of a regular file shall be cleared upon successful
  60. completion; the set-user-ID and set-group-ID bits of other file types
  61. may be cleared.
  62. .SH OPTIONS
  63. The
  64. .IR chgrp
  65. utility shall conform to the Base Definitions volume of POSIX.1\(hy2017,
  66. .IR "Section 12.2" ", " "Utility Syntax Guidelines".
  67. .P
  68. The following options shall be supported by the implementation:
  69. .IP "\fB\-h\fP" 10
  70. For each
  71. .IR file
  72. operand that names a file of type symbolic link,
  73. .IR chgrp
  74. shall attempt to set the group ID of the symbolic link instead of the
  75. file referenced by the symbolic link.
  76. .IP "\fB\-H\fP" 10
  77. If the
  78. .BR \-R
  79. option is specified and a symbolic link referencing a file of type
  80. directory is specified on the command line,
  81. .IR chgrp
  82. shall change the group of the directory referenced by the symbolic link
  83. and all files in the file hierarchy below it.
  84. .IP "\fB\-L\fP" 10
  85. If the
  86. .BR \-R
  87. option is specified and a symbolic link referencing a file of type
  88. directory is specified on the command line or encountered during the
  89. traversal of a file hierarchy,
  90. .IR chgrp
  91. shall change the group of the directory referenced by the symbolic link
  92. and all files in the file hierarchy below it.
  93. .IP "\fB\-P\fP" 10
  94. If the
  95. .BR \-R
  96. option is specified and a symbolic link is specified on the command
  97. line or encountered during the traversal of a file hierarchy,
  98. .IR chgrp
  99. shall change the group ID of the symbolic link. The
  100. .IR chgrp
  101. utility shall not follow the symbolic link to any other part of the
  102. file hierarchy.
  103. .IP "\fB\-R\fP" 10
  104. Recursively change file group IDs. For each
  105. .IR file
  106. operand that names a directory,
  107. .IR chgrp
  108. shall change the group of the directory and all files in the
  109. file hierarchy below it. Unless a
  110. .BR \-H ,
  111. .BR \-L ,
  112. or
  113. .BR \-P
  114. option is specified, it is unspecified which of these options will be
  115. used as the default.
  116. .P
  117. Specifying more than one of the mutually-exclusive options
  118. .BR \-H ,
  119. .BR \-L ,
  120. and
  121. .BR \-P
  122. shall not be considered an error. The last option specified shall
  123. determine the behavior of the utility.
  124. .SH OPERANDS
  125. The following operands shall be supported:
  126. .IP "\fIgroup\fR" 10
  127. A group name from the group database or a numeric group ID. Either
  128. specifies a group ID to be given to each file named by one of the
  129. .IR file
  130. operands. If a numeric
  131. .IR group
  132. operand exists in the group database as a group name, the group ID
  133. number associated with that group name is used as the group ID.
  134. .IP "\fIfile\fR" 10
  135. A pathname of a file whose group ID is to be modified.
  136. .SH STDIN
  137. Not used.
  138. .SH "INPUT FILES"
  139. None.
  140. .SH "ENVIRONMENT VARIABLES"
  141. The following environment variables shall affect the execution of
  142. .IR chgrp :
  143. .IP "\fILANG\fP" 10
  144. Provide a default value for the internationalization variables that are
  145. unset or null. (See the Base Definitions volume of POSIX.1\(hy2017,
  146. .IR "Section 8.2" ", " "Internationalization Variables"
  147. for the precedence of internationalization variables used to determine
  148. the values of locale categories.)
  149. .IP "\fILC_ALL\fP" 10
  150. If set to a non-empty string value, override the values of all the
  151. other internationalization variables.
  152. .IP "\fILC_CTYPE\fP" 10
  153. Determine the locale for the interpretation of sequences of bytes of
  154. text data as characters (for example, single-byte as opposed to
  155. multi-byte characters in arguments).
  156. .IP "\fILC_MESSAGES\fP" 10
  157. .br
  158. Determine the locale that should be used to affect the format and
  159. contents of diagnostic messages written to standard error.
  160. .IP "\fINLSPATH\fP" 10
  161. Determine the location of message catalogs for the processing of
  162. .IR LC_MESSAGES .
  163. .SH "ASYNCHRONOUS EVENTS"
  164. Default.
  165. .SH STDOUT
  166. Not used.
  167. .SH STDERR
  168. The standard error shall be used only for diagnostic messages.
  169. .SH "OUTPUT FILES"
  170. None.
  171. .SH "EXTENDED DESCRIPTION"
  172. None.
  173. .SH "EXIT STATUS"
  174. The following exit values shall be returned:
  175. .IP "\00" 6
  176. The utility executed successfully and all requested changes were made.
  177. .IP >0 6
  178. An error occurred.
  179. .SH "CONSEQUENCES OF ERRORS"
  180. Default.
  181. .LP
  182. .IR "The following sections are informative."
  183. .SH "APPLICATION USAGE"
  184. Only the owner of a file or the user with appropriate privileges may
  185. change the owner or group of a file.
  186. .P
  187. Some implementations restrict the use of
  188. .IR chgrp
  189. to a user with appropriate privileges when the
  190. .IR group
  191. specified is not the effective group ID or one of the supplementary
  192. group IDs of the calling process.
  193. .SH EXAMPLES
  194. None.
  195. .SH RATIONALE
  196. The System V and BSD versions use different exit status codes. Some
  197. implementations used the exit status as a count of the number of errors
  198. that occurred; this practice is unworkable since it can overflow the
  199. range of valid exit status values. The standard developers chose to
  200. mask these by specifying only 0 and >0 as exit values.
  201. .P
  202. The functionality of
  203. .IR chgrp
  204. is described substantially through references to
  205. \fIchown\fR().
  206. In this way, there is no duplication of effort required for describing
  207. the interactions of permissions, multiple groups, and so on.
  208. .SH "FUTURE DIRECTIONS"
  209. None.
  210. .SH "SEE ALSO"
  211. .IR "\fIchmod\fR\^",
  212. .IR "\fIchown\fR\^"
  213. .P
  214. The Base Definitions volume of POSIX.1\(hy2017,
  215. .IR "Chapter 8" ", " "Environment Variables",
  216. .IR "Section 12.2" ", " "Utility Syntax Guidelines"
  217. .P
  218. The System Interfaces volume of POSIX.1\(hy2017,
  219. .IR "\fIchown\fR\^(\|)"
  220. .\"
  221. .SH COPYRIGHT
  222. Portions of this text are reprinted and reproduced in electronic form
  223. from IEEE Std 1003.1-2017, Standard for Information Technology
  224. -- Portable Operating System Interface (POSIX), The Open Group Base
  225. Specifications Issue 7, 2018 Edition,
  226. Copyright (C) 2018 by the Institute of
  227. Electrical and Electronics Engineers, Inc and The Open Group.
  228. In the event of any discrepancy between this version and the original IEEE and
  229. The Open Group Standard, the original IEEE and The Open Group Standard
  230. is the referee document. The original Standard can be obtained online at
  231. http://www.opengroup.org/unix/online.html .
  232. .PP
  233. Any typographical or formatting errors that appear
  234. in this page are most likely
  235. to have been introduced during the conversion of the source files to
  236. man page format. To report such errors, see
  237. https://www.kernel.org/doc/man-pages/reporting_bugs.html .