---
title: "find directory with the most files"
date: "2013-10-23"
path: "/165-find-directory-with-the-most-files.html"
section: "/ramblings"
aliases:
  - "/165"
  - "/165-find-directory-with-the-most-files"
  - "/165.html"
  - "/ramblings/165-find-directory-with-the-most-files.html"
---

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 .
   2004 sub1.client.com
   3487 sub2.client.com
 249516 sub3.client.com
```

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.
