Download teh coreutils package from sunfreeware.com. It contains they GNU version of du, with the -h switch. You will need to ether modify your PATH or set up an alias since the native Solaris version is in /usr/bin and it will get executed first unless you change your PATH or set up an alias.
Try the following, thanks to the book Wicked Cool Shell Scripts:
http://www.intuitive.com/wicked/
#!/bin/sh
# newdf - a friendlier version of df
sedscript="/tmp/newdf.$$"
trap "rm -f $sedscript" EXIT
cat << 'EOF' > $sedscript
function showunit(size)
{ mb = size / 1024; prettymb=(int(mb * 100)) / 100;
gb = mb / 1024; prettygb=(int(gb * 100)) / 100;
if ( substr(size,1,1) !~ "[0-9]" ||
substr(size,2,1) !~ "[0-9]" ) { return size }
else if ( mb < 1) { return size "K" }
else if ( gb < 1) { return prettymb "M" }
else { return prettygb "G" }
}
BEGIN {
printf "%-27s %7s %7s %7s %8s %-s\n",
"Filesystem", "Size", "Used", "Avail", "Capacity", "Mounted"
}
!/Filesystem/ {
size=showunit($2);
used=showunit($3);
avail=showunit($4);
printf "%-27s %7s %7s %7s %8s %-s\n",
$1, size, used, avail, $5, $6
}
EOF
df -k | gawk -f $sedscript
exit 0
hi webofficer
take the advice of bosconet and get the GNU-version. maybe the "ncdu", based on ncurses could be worth a try, too. it can also be found at sunfreeware.com.
and a weired suggestion: ever tried, to replace the solaris8-"du" with one from a solaris9 machine ? ;-)
cannot evaluate this, becaus i've got no sol8, but on my linux-boxes that trick works with some commands (with others not... *gg* )
cheers, jenny
************************
the sweater of a woman fits perfect,
when the men gasp for air. ;-)