I have a large set of directories for which I\'m trying to calculate the sum total size of several hundred .txt files. I tried this, which mostly works:
fin
One alternate solution is to use awk:
find . -name "*.txt" -exec ls -lt {} \; | awk -F " " 'BEGIN { sum=0 } { sum+=$5 } END { print sum }'