Created
August 24, 2013 06:37
-
-
Save pyalot/6326456 to your computer and use it in GitHub Desktop.
Counts all files in the current directory recursively for each contained directory and outputs the count and directory name sorted numerically.
This file contains hidden or 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
#!/usr/bin/env bash | |
function countFiles { | |
for i in $(pwd)/* ; do | |
if [ -d "$i" ]; then | |
echo $(find $i -type f | wc -l) $i | |
fi | |
done | |
} | |
countFiles | sort -n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment