One option is doing something like http://blogs.scalablelogic.com/2014/01/getting-size-and-file-count-of-25.html