Created
February 16, 2026 15:58
-
-
Save do-me/50005aec449f3513a1f0fdfb46786557 to your computer and use it in GitHub Desktop.
Get size of dir, number of files and average file size
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
| read s c < <(find images -type f -printf '%s\n' 2>/dev/null | awk '{t+=$1} END{print t, NR}'); printf "Total size: %s\nFiles: %d\nAverage: %s\n" "$(numfmt --to=iec --suffix=B $s)" "$c" "$(numfmt --to=iec --suffix=B $((c? s/c : 0)))" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment