find directory with the most files

Written by Peter Davies on .

Had an odd issue of locating a client server issue where there was a problem large number of small files.

find . -type d | cut -d/ -f 2 | uniq -c

Resulting in:

user@server:/home/client/domains# find . -type d | cut -d/ -f 2 | uniq -c
      1 .

This showed that the last subdomain had a large number of files. It eventually transpired it was a lot of session files created by a PHP application.