Last active
June 16, 2020 22:32
-
-
Save jspiro/729e64e451d05ba3ce655a34cfb43d2a to your computer and use it in GitHub Desktop.
horrific but working way to summarize file sizes in a directory for evaluating what's tracked by git lfs
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
$ find . -type f -name '*.*' | | |
sed 's/.*\.//' | | |
sort -u | | |
while read ext; do | |
( | |
gfind . -name "*$ext" -printf "%s\n" | | |
sed 's/$/+/' | | |
tr -d '\n' | |
echo 0 | |
) | bc | tr -d '\n' | |
echo -e "\t$ext" | |
done | |
1003744 .exe | |
911328 .zip | |
806448 .dc | |
623008 .pck | |
564880 .mp4 | |
497016 .d | |
351848 .efz | |
323112 .g | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
One little bug which probably didn't affect your results. When simplifying the extension extraction to just
sed 's/.*\.//'
the gfind -name test should have been updated to include a literal period.