Gnuru.org
Productive Linux


Subscribe

 Subscribe via Feedburner in a reader

Enter your email address:

Delivered by FeedBurner


Login
Login:
Password:



Don't have an account?
Sign up to Gnuru.org
Forgot your password?

Removing empty directories
5 March 2004 @ 17:36 GMT
by Paul

Sometimes you need to recurse through a directory tree and remove empty directories. A typical example of doing this is when you you're managing a news server and have removed some newsgroups.

This snippet of perl on the command line should do the trick:

perl -MFile::Find -e 'find( { wanted => sub {}, postprocess => sub { rmdir $File::Find::name } }, @ARGV )'




Comments disabled