-1

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.

0
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 }'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.