Recursively counting files in a directory August 3, 2015 Stuart Leave a comment find . -maxdepth 1 -type d -print0 | xargs -0 -I {} sh -c 'echo $(find "{}" | wc -l) "{}"' | sort -n