Skip navigation.

极湖

无不用其“极”

Posts tagged with "Howto"

Linux下一次删除所有空目录的方法

, ,

方法一:用 Perl 实现

程序
#!/usr/bin/perl
use File::Find;
finddepth(sub{rmdir},'.')


命令
perl -MFile::Find -e"finddepth(sub{rmdir},'.')"


方法二:用 Shell Script 实现

find -depth -type d -empty -exec rmdir {} \;

以上方法来自:http://duramecho.com/ComputerPrograms/DeleteEmptyDirectories/index.html
December 2009
S M T W T F S
November 2009January 2010
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31