Here’s the table of contents:

  1. Using bash

Using bash

Save as FileCountForEveryDirectory.sh

for file in ./*
do
  if [ -d "$file" ]; then
  	echo "$file"
  	find "$file"//. ! -name . -print | grep -c //
  fi
done

And call

cd /tmp/
/home/user/FileCountForEveryDirectory.sh

See!