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?

  • Does find have a max-depth option on Solaris? Can you pipe that out to an xargs du? – mpbloch Aug 12 '09 at 16:27
6

Won't this do it?

cd $TOP_LEVEL_DIR
du -s *
| improve this answer | |
  • 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.

| improve this answer | |
  • Good solution, I just needed something quick and dirty for now, thanks. – kekoav Aug 12 '09 at 18:25
  • 1
    Chances is that you have GNU du at /usr/gnu/bin/du. – Lester Cheung Aug 14 '09 at 2:48
0

Will this work on Solaris?

du | egrep -v '.*/.*/.*'
| improve this answer | |
0

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

| improve this answer | |
0

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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.