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.

The du command in my solaris environment has very terse help, no man page, and doesn't support the --max-depth option seen in the linux world.

I want to know how much space a given directory occupies. What's the simplest way to get this in Solaris?

share|improve this question
    
Found an answer. Rather than deleting the question, I figure someone else might like to know the answer: du -sk <dirname> –  Brian Vandenberg May 10 '11 at 19:15
    
you can answer your own question then. –  Nitrodist May 10 '11 at 19:56
    
To add to what @Nitrodist suggests: Please accept an answer or post your own and accept it once that is possible. This way, the system recognizes this issue as solved and doesn't bump it to the front page in the future. –  Daniel Beck May 10 '11 at 20:35
    
I have to wait 8 hours before I can post an answer to my own question. –  Brian Vandenberg May 10 '11 at 20:44
    
Solaris provides a du man page, but your sysadmin may have chosen not to install man pages. You can find them online at download.oracle.com/docs/cd/E19253-01/index.html –  alanc May 10 '11 at 23:59

2 Answers 2

Hack, but should work:

du | egrep -v '.*/.*/.*/'

This will print only the lines with 2 or fewer '/' marks.

share|improve this answer
up vote 2 down vote accepted
du -s <dirname>

... or to get it to print the size in kilobytes:

du -sk <dirname>
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.