1

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.

Deckard
  • 111
  • 4
  • 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 07 '11 at 02:05

2 Answers2

2

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
8117498 Downloads

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.

shellter
  • 121
  • 3
0

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

Fred Foo
  • 126
  • 3
  • 1
    Hm... it says `-b` is also invalid. –  Sep 06 '11 at 10:43
  • Would you give me a tip? I just need to roughly check its size. –  Sep 06 '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). –  Sep 06 '11 at 16:06