Welcome to WebmasterWorld Guest from 62.210.77.51
Forum Moderators: bakedjake
[webmasterworld.com...]
This will have to be a shell script in a for loop, not a quick one liner becuase the loop will first have to identify the subdirectory, then do the count, and then print subdirectory name and file count to the screen.
#Counts files in subdirectories
date_stamp=`date +"%m%d%Y.%H%M%S"`
temp_file="temp.$date_stamp.txt"
find . -type d > $temp_file
exec 3< $temp_file
until [ $done ]
do
read <&3 myline
if [ $?!= 0 ]; then
done=1
continue
fi
dircount=`find $myline"/." \( -name . -o -prune \) -type f ¦ wc -l`
echo "$dircount"$myline
done
rm $temp_file
#EOF