Last active
December 21, 2015 15:55
-
-
Save pavgup/9507202f4aa133901d1f to your computer and use it in GitHub Desktop.
count files recursively in directories and sort results
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -maxdepth 3 -noleaf -type d -exec sh -c "ls -ltaR \"{}\" | wc -l | tr \"\n\" \" \" && echo \"{}\"" \; | sort -n | |
# or more simply without a sort: | |
find . -type d -maxdepth 1 -print0 -exec sh -c 'find "{}" -type f | wc -l' \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment