Created
October 1, 2019 19:00
-
-
Save eiro/0ff057f154e811ba370c944d4e8fc169 to your computer and use it in GitHub Desktop.
detect the fat of your pdf
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
count_fat () awk -vmd5=1 -vfile=2 ' | |
{ ++used[$md5] ; name[$md5]=$file } | |
END { | |
# is fat only if used more than 1 time | |
for (n in name) | |
if (--used[n]) | |
print name[n],used[n] | |
} | |
' | |
total_fat () awk -vtimes=2 -vsize=3 ' | |
{ sum += $times * $size } | |
END { print sum } | |
' | |
md5sum videos/* | | |
count_fat | | |
tee fat | | |
awk '{print $1}' | | |
xargs stat -c '%n %s' > sizes | |
{ join fat sizes | total_fat | |
stat -c%s *.pdf | |
print '10k/100*p' | |
} |dc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment