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 use Ubuntu 9.04 and I would like to know how to display how much space is taken up by all the contents held recursively in one directory using a Linux terminal?

Should I use ls -l along with some other options?

share|improve this question

migrated from stackoverflow.com Oct 4 '09 at 15:29

This question came from our site for professional and enthusiast programmers.

up vote 12 down vote accepted

You can use the following:

du -sh <your-dir>

Where:

  • s means summarize this directory only
  • h means human-readable units (MB, GB etc)
share|improve this answer
3  
The -s means "summarize this directory only", and -h means "human-readable units (like MB, GB)". – unwind Oct 4 '09 at 15:12
    
If this were code du -sh -> alias disc-usage=du; disc-usage --human-readable --summarize – Thomas Jung Oct 4 '09 at 15:21
    
This also works just fine under windows, with Cygwin. – Phoshi Oct 4 '09 at 15:32
    
The -c option (produce a total line) tends to also be helpful, if you need to specify a few arguments! – Jefromi Oct 5 '09 at 20:33

You must log in to answer this question.

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