drosofff
9/19/2016 - 3:11 PM

Calculate total used disk space by files older than 180 days using find

From http://stackoverflow.com/questions/17419337/calculate-total-used-disk-space-by-files-older-than-180-days-using-find Here an example for space occupied by files older than 5 years (1825 days)

find . -type f -mtime +1825 -printf '%s\n' | awk '{a+=$1;} END {printf "%.1f GB\n", a/2**30;}'