Find all empty files in a UNIX filesystem

Using the find command, this locates all files with zero length.


To find all empty files on the entire system,

find / -size 0 -print

To find all empty files from the current directory down,

find . -size 0 -print

 

About Quinn McHenry

Quinn was one of the original co-founders of Tech-Recipes. He is currently crafting iOS applications as a senior developer at Small Planet Digital in Brooklyn, New York.
View more articles by Quinn McHenry

The Conversation

Follow the reactions below and share your own thoughts.

Leave a Reply

You may also like-

Delete Solaris Files Older Than a Certain Date and TimeDeleting files conditionally based on their age is sometimes useful. This tech-recipe describes a procedure for deleting aged files using the UNIX find command. ...