Article View: news.software.nntp
Article #15393Re: A script to find and remove empty directories
From: Casper H.S. Dik - Network Securi...
Date: Thu, 27 Feb 1997 00:00
Date: Thu, 27 Feb 1997 00:00
28 lines
1521 bytes
1521 bytes
Jeff Garzik <jeff.garzik@spinne.com> writes: >Here is a quick and dirty Perl script that removes empty directories >recursively. There may be some way to do this with shell utils, but it >was faster for me to simply write this. :) It should be easy to modify >the output to show newsgroups removed, for logging purposes or whatever. Here's my Q&D shell version: cd /var/spool/news find . -depth -type d -print | xargs rmdir (rmdir will only remove non-empty directories, -depth causes find to print subdirectories befor ethere parents. So you get a lot of error messages, who cares? Casper -- Expressed in this posting are my opinions. They are in no way related to opinions held by my employer, Sun Microsystems. Statements on Sun products included here are not gospel and may be fiction rather than truth.
Technical Details
Message-ID:
<casper.857054045@uk-usenet.uk.sun.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<33132F95.54538512@spinne.com>Show Full Headers
Complete Article Headers
Message-ID: <casper.857054045@uk-usenet.uk.sun.com> Subject: Re: A script to find and remove empty directories Date: Thu, 27 Feb 1997 00:00:00 +0000 From: Casper.Dik@Holland.Sun.COM (Casper H.S. Dik - Network Security Engineer) References: <33132F95.54538512@spinne.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 221826563 Supersedes: <cancel.casper.857054045@uk-usenet.uk.sun.com> Organization: Sun Microsystems, Netherlands Newsgroups: news.software.nntp