#!/bin/bash
file=/tmp/file.$$
>$file
t=0
f=`ls -l / |awk '{print $9}'`
for i in $f
do
cd /
if [ "$i" != "proc" ];then
du -sk $i|awk '
{ $1=$1/1024; printf "%.2f\t",$1}{print $2}' >>$file
fi
done
awk 'BEGIN{print "M DIR\n--------------"}'
cat $file |sort -n |while read ff
do
x=`echo $ff |awk '{print $1}'`
if [ "$x" != "0.00" ];
then
echo $ff
fi
t=$((++t))
done
~
阅读(1279) | 评论(0) | 转发(0) |