mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
doc: rmdir --recursive substitutes
* doc/coreutils.texi (rmdir invocation): Add note on how to remove empty subdirectories recursively.
This commit is contained in:
1 parent
e9789a1cf2
commit
eebed78799
1 file changed
+13
-1
+13
-1
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user