---
title: "Find and delete zero sized files"
date: "2009-08-18"
path: "/41-find-and-delete-zero-sized-files.html"
section: "/ramblings"
aliases:
  - "/41"
  - "/41-find-and-delete-zero-sized-files"
  - "/41.html"
  - "/ramblings/41-find-and-delete-zero-sized-files.html"
---

I recently had a "disk full" issue on a server but even after clearing out the apache logs that had failed to rotate the website that the server was running showed broken images where thumbnails should be.

After a little investigation it turned out the thumbnail code had tried to replace/create "zero" sized thumbnail images. The complication was that the images were spread across multiple directories meaning that it was going to be almost impossible to delete manually.

A combination of Google searches resulted in:

```
find ./ -type f -size 0 -exec rm {} \;
```

Very useful! And of course I backed up first!
