Last active
December 22, 2018 19:56
-
-
Save mislav/4732458 to your computer and use it in GitHub Desktop.
Find "*.log" files in your home dir, sort them by fattest-first, and calculate the size of them all together.
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
find ~ -name '*.log' -print0 | xargs -0 -L1 stat -f'%z %N' | sort -rn | tee fat-logfiles.txt | head | |
awk '{ total += $1 } END { printf "total: %5.2f MiB\n", total/1024/1024 }' < fat-logfiles.txt |
Maybe /tmp/fat-logfiles.txt
, not to litter your working dir.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
linux version: