Using find to locate all zero length files
Posted August 4th, 2011 in Linux/Unix/BSD and Quick Tips
A little while ago I posted how to use the Linux/Unix/OSX find command to locate files bigger or smaller than a particular size but didn't cover how to find zero length files. This is shown here.
Find zero length files
It's very easy, just like so:
find . -size 0
"find" is obviously the command itself.
The . means start searching from the current directory. If you wanted to find files from another directory then replace the . with the directory. For example to search everything under the system log directory then "find /var/log <other parameters>" is what you would do.
Finally the "-size 0" flag specifies just to find zero length files.
Related posts:
- Using find to locate files bigger or smaller than a size (Thursday, April 14th 2011)
- Remove all .svn directories (Friday, March 11th 2011)
- Find all symbolic links with the find command (Friday, June 25th 2010)
- Using find to locate files modified in the last 24 hours etc (Friday, December 28th 2007)

Comments
blog comments powered by Disqus