#!/bin/bash#command usage descriptionfunction usage(){ echo -e "Usage:nt$0 DIR_NAME" exit}# Check if user is rootif [ $(id -u) != "0" ]; then echo "Error: You must be root to run this script, please use root to use it!!!" exit 1fi#judge the argvif [ $# -ne 1 ]then echo "the usage of the command is ERROR!!!" usagefidir_name=$1i=0if [ ! -d $dir_name ]then echo "the argv is not a direction!!!" usageelse cd $dir_name echo "pwd: " `pwd` du -ahS | sort -nr | while read line do myline=`echo $line | awk '{print $2}'` if [ -f $myline ] && [ $i -lt 5 ] then echo $line let i++ fi done fi#!/bin/bash#command usage descriptionfunction usage(){ echo -e "Usage:nt$0 DIR_NAME" exit}# Check if user is rootif [ $(id -u) != "0" ]; then echo "Error: You must be root to run this script, please use root to use it!!!" exit 1fi#judge the argvif [ $# -ne 1 ]then echo "the usage of the command is ERROR!!!" usagefidir_name=$1i=0if [ ! -d $dir_name ]then echo "the argv is not a direction!!!" usageelse cd $dir_name echo "pwd: " `pwd` du -ahS | sort -nr | while read line do myline=`echo $line | awk '{print $2}'` if [ -f $myline ] && [ $i -lt 5 ] then echo $line let i++ fi done fi