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

Possible Duplicate:
How do I get the size of a Linux or Mac OS X directory from the command-line?

I am in a folder, and I want a list of all the sub-directories and their total sizes.

I dont' want it to list all the sub-directories and files in a recursive manner, just the top level directories and the total size it uses on my drive.

How can I do this?

share|improve this question

marked as duplicate by slhck Jan 27 '13 at 17:11

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Why the down votes? – Matteo Jan 27 '13 at 17:09
@Matteo I'd say that this question does not show research effort. In fact, the Related list shows the question which is essentially a duplicate, which means the OP should have seen it when they were searching for an answer to their question before they posted it. – slhck Jan 27 '13 at 17:14
@slhck I agree but I was more hinting that a down vote should be commented (or the question flagged). – Matteo Jan 27 '13 at 21:01
@slhck And actually the question is not an exact duplicate. In the possible duplicate nobody speaks of excluding files (du -hs * does not differentiate ...) – Matteo Jan 27 '13 at 21:03
@slhck I'm doing "research effort" right now just came across this page as most prominent Google hit. What does that say about your comment? – geotheory Feb 1 '15 at 13:42
up vote 23 down vote accepted

With du you can compute the size of a directory:

du -hs dir

if you have only directories you can just (-h will return a human readable units, -s will not recurse)

du -hs *

if in the folder you have contains files and folders:

find . -maxdepth 1 -type d -mindepth 1 -exec du -hs {} \;

find will list all the directories (-type d) in the current folder (-mindepth 1 -maxdepth 1) and execute du on them.

share|improve this answer
thanks, I should alias this one! – user27449 Jan 27 '13 at 18:53

Try typing the following from inside the directory you're interested in


Works on unix so should work on mac

share|improve this answer
Yes but it lists all the files and folders seperately, I just want the folder sizes (totals). – user27449 Jan 27 '13 at 18:52

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