Skip to main content

count

Count the number and size of files in a directory (including subdirectories).

#!/bin/bash
for file in ./*
do
if test -d $file
then
#echo $file >> test.log
du -sh $file >> test.log
ls -lR|grep "^-" $file |wc -l >> test.log
fi
done