I am trying to find the total disk space used by files older than 180 days in a particular directory. This is what I\'m using:
find . -mtime +180 -exec d
You can print file size with find using the -printf option, but you still need awk to sum.
find
-printf
awk
For example, total size of all files older than 365 days:
find . -type f -mtime +356 -printf '%s\n' \ | awk '{a+=$1;} END {printf "%.1f GB\n", a/2**30;}'