123456789101112131415#!/bin/bashif [ "$1" = "" ]; then listlength=10else listlength=$1fidu -s * | sort -rn | head -n $listlength \| sed s/^[0-9]*// | while read itemdo if [ "$item" = "" ]; then continue fi echo `du -hs "$item"`done Tested on Mac OS X and Ubuntu. Comments: Please enable JavaScript to view the comments powered by Disqus.