Last active
July 31, 2020 23:49
-
-
Save kmturley/5bcae3dc49c3bbb942411837e1b0fa71 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
# Usage: | |
# bash stats.sh ./directory | |
# bash stats.sh ./directory > stats.log | |
( | |
# Find number of children | |
find $1 -maxdepth 1 -type d -print0 | while read -d '' -r dir; do num=$(find $dir -ls | wc -l); printf "%5d %s\n" "$num" "$dir"; done | |
# Find size | |
du -hd1 $1 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment