How do I calculate the block-filesize that all the files in a directory take? and how do I calculate the real size of all the files in the directory?
I tried some variations with df/du but they don't seem to work.
How do I calculate the block-filesize that all the files in a directory take? and how do I calculate the real size of all the files in the directory?
I tried some variations with df/du but they don't seem to work.
ls -sa | awk '{ SUM += $1 } END { print "Block size=" SUM }'
the -s option of ls print the allocated size of each file, in blocks
And the real size :
ls -la | awk '{ SUM += $5 } END { print "Dir size=" SUM }'