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

add comment

1 Answer 1

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

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.