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

rmdir.1p (5511B)


  1. '\" et
  2. .TH RMDIR "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. rmdir
  12. \(em remove directories
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. rmdir \fB[\fR-p\fB]\fI dir\fR...
  17. .fi
  18. .SH DESCRIPTION
  19. The
  20. .IR rmdir
  21. utility shall remove the directory entry specified by each
  22. .IR dir
  23. operand.
  24. .P
  25. For each
  26. .IR dir
  27. operand, the
  28. .IR rmdir
  29. utility shall perform actions equivalent to the
  30. \fIrmdir\fR()
  31. function called with the
  32. .IR dir
  33. operand as its only argument.
  34. .P
  35. Directories shall be processed in the order specified. If a directory
  36. and a subdirectory of that directory are specified in a single
  37. invocation of the
  38. .IR rmdir
  39. utility, the application shall specify the subdirectory before the
  40. parent directory so that the parent directory will be empty when the
  41. .IR rmdir
  42. utility tries to remove it.
  43. .SH OPTIONS
  44. The
  45. .IR rmdir
  46. utility shall conform to the Base Definitions volume of POSIX.1\(hy2017,
  47. .IR "Section 12.2" ", " "Utility Syntax Guidelines".
  48. .P
  49. The following option shall be supported:
  50. .IP "\fB\-p\fP" 10
  51. Remove all directories in a pathname. For each
  52. .IR dir
  53. operand:
  54. .RS 10
  55. .IP " 1." 4
  56. The directory entry it names shall be removed.
  57. .IP " 2." 4
  58. If the
  59. .IR dir
  60. operand includes more than one pathname component, effects equivalent
  61. to the following command shall occur:
  62. .RS 4
  63. .sp
  64. .RS 4
  65. .nf
  66. rmdir -p $(dirname \fIdir\fP)
  67. .fi
  68. .P
  69. .RE
  70. .RE
  71. .RE
  72. .SH OPERANDS
  73. The following operand shall be supported:
  74. .IP "\fIdir\fR" 10
  75. A pathname of an empty directory to be removed.
  76. .SH STDIN
  77. Not used.
  78. .SH "INPUT FILES"
  79. None.
  80. .SH "ENVIRONMENT VARIABLES"
  81. The following environment variables shall affect the execution of
  82. .IR rmdir :
  83. .IP "\fILANG\fP" 10
  84. Provide a default value for the internationalization variables that are
  85. unset or null. (See the Base Definitions volume of POSIX.1\(hy2017,
  86. .IR "Section 8.2" ", " "Internationalization Variables"
  87. for the precedence of internationalization variables used to determine
  88. the values of locale categories.)
  89. .IP "\fILC_ALL\fP" 10
  90. If set to a non-empty string value, override the values of all the
  91. other internationalization variables.
  92. .IP "\fILC_CTYPE\fP" 10
  93. Determine the locale for the interpretation of sequences of bytes of
  94. text data as characters (for example, single-byte as opposed to
  95. multi-byte characters in arguments).
  96. .IP "\fILC_MESSAGES\fP" 10
  97. .br
  98. Determine the locale that should be used to affect the format and
  99. contents of diagnostic messages written to standard error.
  100. .IP "\fINLSPATH\fP" 10
  101. Determine the location of message catalogs for the processing of
  102. .IR LC_MESSAGES .
  103. .SH "ASYNCHRONOUS EVENTS"
  104. Default.
  105. .SH STDOUT
  106. Not used.
  107. .SH STDERR
  108. The standard error shall be used only for diagnostic messages.
  109. .SH "OUTPUT FILES"
  110. None.
  111. .SH "EXTENDED DESCRIPTION"
  112. None.
  113. .SH "EXIT STATUS"
  114. The following exit values shall be returned:
  115. .IP "\00" 6
  116. Each directory entry specified by a
  117. .IR dir
  118. operand was removed successfully.
  119. .IP >0 6
  120. An error occurred.
  121. .SH "CONSEQUENCES OF ERRORS"
  122. Default.
  123. .LP
  124. .IR "The following sections are informative."
  125. .SH "APPLICATION USAGE"
  126. The definition of an empty directory is one that contains, at most,
  127. directory entries for dot and dot-dot.
  128. .SH EXAMPLES
  129. If a directory
  130. .BR a
  131. in the current directory is empty except it contains a directory
  132. .BR b
  133. and
  134. .BR a/b
  135. is empty except it contains a directory
  136. .BR c :
  137. .sp
  138. .RS 4
  139. .nf
  140. rmdir -p a/b/c
  141. .fi
  142. .P
  143. .RE
  144. .P
  145. removes all three directories.
  146. .SH RATIONALE
  147. On historical System V systems, the
  148. .BR \-p
  149. option also caused a message to be written to the standard output. The
  150. message indicated whether the whole path was removed or whether part of
  151. the path remained for some reason. The STDERR section requires this
  152. diagnostic when the entire path specified by a
  153. .IR dir
  154. operand is not removed, but does not allow the status message reporting
  155. success to be written as a diagnostic.
  156. .P
  157. The
  158. .IR rmdir
  159. utility on System V also included a
  160. .BR \-s
  161. option that suppressed the informational message output by the
  162. .BR \-p
  163. option. This option has been omitted because the informational message
  164. is not specified by this volume of POSIX.1\(hy2017.
  165. .SH "FUTURE DIRECTIONS"
  166. None.
  167. .SH "SEE ALSO"
  168. .IR "\fIrm\fR\^"
  169. .P
  170. The Base Definitions volume of POSIX.1\(hy2017,
  171. .IR "Chapter 8" ", " "Environment Variables",
  172. .IR "Section 12.2" ", " "Utility Syntax Guidelines"
  173. .P
  174. The System Interfaces volume of POSIX.1\(hy2017,
  175. .IR "\fIremove\fR\^(\|)",
  176. .IR "\fIrmdir\fR\^(\|)",
  177. .IR "\fIunlink\fR\^(\|)"
  178. .\"
  179. .SH COPYRIGHT
  180. Portions of this text are reprinted and reproduced in electronic form
  181. from IEEE Std 1003.1-2017, Standard for Information Technology
  182. -- Portable Operating System Interface (POSIX), The Open Group Base
  183. Specifications Issue 7, 2018 Edition,
  184. Copyright (C) 2018 by the Institute of
  185. Electrical and Electronics Engineers, Inc and The Open Group.
  186. In the event of any discrepancy between this version and the original IEEE and
  187. The Open Group Standard, the original IEEE and The Open Group Standard
  188. is the referee document. The original Standard can be obtained online at
  189. http://www.opengroup.org/unix/online.html .
  190. .PP
  191. Any typographical or formatting errors that appear
  192. in this page are most likely
  193. to have been introduced during the conversion of the source files to
  194. man page format. To report such errors, see
  195. https://www.kernel.org/doc/man-pages/reporting_bugs.html .