CharlyBr on Apr 17th, 2009Finding the total size of a set of files with awk
If you need to sum the total size of files in a directory or matching a pattern, an easy solution is to use awk.
I needed to calculate this total for a set of javascript files, I used this command line:
$ find App/ -name ‘*.js’ -exec ls -l \{\} \; | awk ‘{sum+=$5} END {print sum}’
1929403
For [...]