Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to read the size of a folder from the command line. ls -lh shows all folders as being 4k, which presumably is the size of the footprint of the folder itself, rather than the contained files. I would like to read the size of all contained files within the folder. is this possible?

share|improve this question

3 Answers 3

up vote 5 down vote accepted

You can use the du command:

du -sh foldername
share|improve this answer
du -s folder

-s stands for summarize.

share|improve this answer

You can also use

du -csh foldername/*

which gives file and folder sizes under "foldername" separately and the total size in last row.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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