# @(#)largest 1.2 /sccs/src/cmd/sadmin/shell/s.largest # Find largest files under the given directory. #! chmod +x ${file} if [ x$1 = x ] then d=. else d=$1 fi if [ x$2 = x ] then b=10 else b=$2 fi echo " the ${b} largest files under ${d}" a="`expr 0${b} "*" 10`" cd ${d} du -a | sort -bnr +0 -1 | sed -n 1,0${a}'s:^[0-9]* \./:ls -ldsu :p' | sh - | grep -v '^ *[0-9][0-9]* d' | sed -n 1,0${b}p | sort -bnr +5 -6