Add all file sizes in ls -l

solaris 10 (c shell)

need a command or script that will add up all (*.tmp) file sizes in bytes of a single directory, or kbytes, no matter

This should work in both bourne and c shells. What I don't have is what your ls -l output looks like -- if solaris' is different than mine, you may need to use a different column than 5.

$ ls -l | awk '/^-/ { T += $5 } END { printf("%dK\n", T/1024); }'
758247K

$