写了一个统计一堆文件总大小的script
2005年5月8日
3 条评论
使用方法 mycount.sh “*.ext”
没有处理目录,懒了
bash-2.05b$ cat ~/bin/mycount.sh
#!/bin/sh
total=0
list=`ls $1`
for item in $list
do
size=`ls -l $item|awk ‘{print $5}’`
total=`expr $total + $size`
done
echo $total
分类: saving