summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2021-01-18 21:08:39 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2021-01-18 21:09:27 -0800
commiteebed78799a7996dd80b66c493a0fc199705dea3 (patch)
treef7ed95fa0168d21f11ea493123c83b991bd1f854
parente9789a1cf2d9a1fd5bc4177b8f27f0a93ff2ed78 (diff)
doc: rmdir --recursive substitutes
* doc/coreutils.texi (rmdir invocation): Add note on how to remove empty subdirectories recursively.
-rw-r--r--doc/coreutils.texi14
1 files changed, 13 insertions, 1 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index fe2fc52b7..94c9fbfa5 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -11006,7 +11006,19 @@ Give a diagnostic for each successful removal.
@end table
-@xref{rm invocation}, for how to remove non-empty directories (recursively).
+@xref{rm invocation}, for how to remove non-empty directories recursively.
+
+To remove all empty directories under @var{dirname}, including
+directories that become empty because other directories are removed,
+you can use either of the following commands:
+
+@example
+# This uses GNU extensions.
+find @var{dirname} -type d -empty -delete
+
+# This runs on any POSIX platform.
+find @var{dirname} -depth -type d -exec rmdir @{@} +
+@end example
@exitstatus