## FreeBSD and Linux, /bin/sh ## ddsort() { if [ -d "$1" ] ; then dir=`echo "$1" | sed -e "s;/$;;"` dir="${dir}/*" elif [ -n "$1" ] ; then dir="$1" else dir="*" fi du -sck ${dir} 2>/dev/null | awk '{printf "%010.4f//%s\n", $1/1024,$2}' |\ sort -r | awk -F"//" '{printf "% 10.1fMB\t%s\n", $1,$2}' }