使用 Linux 命令行查找并删除所有空目录

为了递归查找并删除当前目录(.)中的所有空子目录,使用此命令:

remove-empty-dirs.sh
find . -depth -type d -print0 | xargs -0 rmdir

此命令将**只删除空目录!**任何文件或非空目录都不会被修改。

各部分含义说明:


Check out similar posts by category: Linux