#!/bin/sh # top-ten-files if [ "$1" = "" ]; then WHERE=/ else #WHERE="$1 -mount" # if your find uses "-mount" WHERE="$1 -xdev" # if your find uses "-xdev" fi TEMP=/tmp/top-ten-files.$$ find $WHERE -type f -exec /bin/ls -s {} ';' | sort -nr | head | awk '{ print $2 }' > $TEMP for file in `cat $TEMP` do DETAILS=`ls -l $file | awk '{ print $3 " " $4 }'` echo $file $DETAILS done rm -f $TEMP exit 0