Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .