[Gllug] # files in a subdir

Murray Walker MurrayW at fool.co.uk
Thu Sep 20 17:26:58 UTC 2001


hi,

blagging an answer to a question:

if I wanted to find the respective sizes of all the subdirectories of the
cwd, I could do something like:

du -sk *

but if I wanted to find the *number of files* in each subdirectory, how
would I do that?

I could use du -a | wc for each subdirectory, but I was wondering if there
was a neater way than listing each file and wc'ing it?  Thinking about it,
I'm not sure why, but I thought maybe the filesystem would keep a track of
this.  That might have been a silly assumption on my part....

Murray.

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list