Server Fault is a question and answer site for system and network administrators. 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

This is the server info(uname -a)

SunOS Tiger2 5.7 Generic_106541-16 sun4u sparc SUNW,Ultra-Enterprise

And I want to check some directory size including its all children directories. I fount du -sh /some command, but it doesn't work.

My server says -h is invalid. I guess it's too old maybe.

Thank you.

share|improve this question

migrated from Sep 7 '11 at 2:18

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

Try: man du. I believe you'll find du -sk /some will give you the summary size in kilobytes. Omit the k and it will be in 0.5 KiB blocks. Omit the -s and it will give you the size of each directory (and its descendents) as it processes it. If you try to use options that are not supported, expect to get messages about invalid options. – Jonathan Leffler Sep 7 '11 at 2:05

If you're looking to find which directory is going insane with size, try

cd ${mountPointDirWhereThingsAreGettingTooTight}
du -s * | sort -n
62719   usr
4043953 Pictures
4703272 AppData
5193812 VirtualBox VMs

Then, if 1 directory stands out as way over-sized, you can cd into that dir and repeat the du ... and repeat until to locate the exact problem.

You can add | tail -20 or similar to reduce the output.

Many systems support k, m options to indicate results in Kilobytes or Megabytes.

I hope this helps.

share|improve this answer

Try du -bc and check the last line of the output. Note that du provides just a raw estimate.

share|improve this answer
Hm... it says -b is also invalid. – Deckard Sep 6 '11 at 10:43
Would you give me a tip? I just need to roughly check its size. – Deckard Sep 6 '11 at 10:51
@Deckard: then use just du -c to get the total and look up in du(1) what exactly it's reporting; I think it's disk blocksize or something, so you'll may have to do some arithmetic to get kBs. Or install the GNU shell utilities, those have all the options you need (and many more). – larsmans Sep 6 '11 at 16:06

Your Answer


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.