Article View: news.software.nntp
Article #19544Re: Quick way to list how many files in a each subdirectory?
From: Matt Dillon
Date: Wed, 23 Jul 1997 00:00
Date: Wed, 23 Jul 1997 00:00
39 lines
1686 bytes
1686 bytes
:In article <823ep57gog.fsf@manic.eecs.umich.edu>,
:Michael Hucka <hucka@eecs.umich.edu> wrote:
:>Maybe someone can save me the time of inventing this wheel: does anyone have
:>a utility that will walk down a directory tree and list how many files are in
:>each subdirectory? I don't need any other info, just the number of files.
:>(I want to go through the news spool and hunt for bloated directories.)
:>
:>--
:>Mike Hucka hucka@umich.edu http://www.eecs.umich.edu/~hucka University
:> PhD to be, computational models of human visual processing (AI Lab) of
:> UNIX systems administrator & programmer/analyst (EECS DCO) Michigan
You can often find bloat or potential bloat by looking at the size of the
directory itself:
#!/bin/csh -f
#
# or wherever your news spool is
cd /news/spool/news
find . -type d -print >file
foreach i ( `cat file` )
ls -lda $i
end
% ./lsdirs > file2
% sort -n +4 file2
(untested, but something like the above ought to work)
-Matt
Technical Details
Message-ID:
<5r5oc3$sgr$1@flea.best.net>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:
<823ep57gog.fsf@manic.eecs.umich.edu>Show Full Headers
Complete Article Headers
Message-ID: <5r5oc3$sgr$1@flea.best.net> Subject: Re: Quick way to list how many files in a each subdirectory? Date: Wed, 23 Jul 1997 00:00:00 +0000 From: dillon@best.net (Matt Dillon) References: <823ep57gog.fsf@manic.eecs.umich.edu> 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: 258421672 Organization: Best Internet Communications, Inc. - 415 964 BEST Newsgroups: news.software.nntp