So I have a directory called Foo, let's say, with a directory  
structure like this:

Foo
   Bar
     A
     B
   Car
     A
     B
     C
   Dar
     A
   Ear

Each directory, subdir, & sub-subdir has files in it.

What command/script/piped list of commands can I run that will give me  
output like this:

120 Bar
200 Car
6   Dar
98  Ear

In other words, return the total number of files in each subdir,  
including the sub-subdir's, but NOT report back the total for each sub- 
subdir, just the total of those sub-subdir's as part of the subdir.

In other words, NOT this:

120 Bar
60  A
60  B
200 Car
100 A
50  B
50  C
6   Dar
5   A
98  Ear

I found this, after much Googling:

find . -type f -execdir pwd \; | sort | uniq -c | sort

But it does what I do NOT want - tell me totals for each sub-subdir,  
and NOT subdirs!

Anyone have any ideas?

Tks!

Scott
--
R. Scott Granneman
[email protected] ~ www.granneman.com
Full list of publications @ http://www.granneman.com/publications
   My new book: Google Apps Deciphered @ http://www.granneman.com/books

"I'm reading an interesting book about anti-gravity. I just can't put  
it down."
       ---Anonymous

--~--~---------~--~----~------------~-------~--~----~
Central West End Linux Users Group (via Google Groups)
Main page: http://www.cwelug.org
To post: [email protected]
To subscribe: [email protected]
To unsubscribe: [email protected]
More options: http://groups.google.com/group/cwelug
-~----------~----~----~----~------~----~------~--~---

Reply via email to