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 know this is a very basic question, but I searched the web and did not find a simple answer. I'm sure it's some kind of two or three letter command, right?

share|improve this question

2 Answers 2

up vote 25 down vote accepted

du -s directory, as in "disk usage, sum"

Use du -sk to show the size in kilobytes (default is to show number of 512-byte blocks), or du -sh for a more human-friendly output. For more options, type man du.

share|improve this answer
    
man du thanks!! –  Langel Mar 10 '12 at 18:55
    
Actually I wanted 'du -s -b' so the size is in bytes. I don't know why the default is kilobytes without a 'kb' but it wasn't a convincing answer! ;D –  Langel Mar 10 '12 at 19:02
5  
You can use -h flag for 'human readable', this makes automatic conversion in KB, MB, ect. –  Kahil Mar 10 '12 at 19:14
    
@Martin this is my favorite flag as well. –  David Mar 11 '12 at 0:37

This is the same as -s, but replace 0 with 1 and you can get just the content in the folder:

du -h -d 0 /path/to/file

If you want the whole volume, you should use df instead of du (path is optional):

df -H /

Off-topic: One (very) spooky thing: I happend to be just a street away from Arne Stenström.

/Robert

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.