5

I would like to do the Linux equivalent of du --max-depth=1 on Solaris.

I cannot find an equivalent in the man pages. Any alternatives?

kekoav
  • 153
  • 1
  • 1
  • 6

5 Answers5

7

Won't this do it?

cd $TOP_LEVEL_DIR
du -s *
Justin Ellison
  • 718
  • 5
  • 9
  • Yes, this works almost exactly like the Linux way, without a total count at the bottom, but I can use `du -s .` to get that one. I modified to du -sh * for a more readable output. Thanks! – kekoav Aug 12 '09 at 18:23
2

You could always install gnu fileutils and get the same functionality. Blastwave would have pre-built packages for newer versions of Solaris.

Travis Campbell
  • 1,466
  • 7
  • 15
0

find ./ -type d -print -maxdepth 1|xargs du -hs

0

Will this work on Solaris?

du | egrep -v '.*/.*/.*'
Josh Kelley
  • 983
  • 1
  • 7
  • 17
0

The du command included with OpenSolaris does support --max-depth!

X-Istence
  • 752
  • 1
  • 8
  • 18