Add up a column of numbers at the Unix shell
Here goes
cat files.txt | xargs ls -l | cut -c 23-30 |
awk '{total = total + $1}END{print total}'
... | paste -sd+ - | bc
is the shortest one I've found (from the UNIX Command Line blog).
Edit: added the -
argument for portability, thanks @Dogbert and @Owen.