#! /bin/bash echo "hello" number=0 for item in ./* #for item in ./*.txt, this will count on all file ends with .txt in the folder do number=$(( number + 1 )) #echo "$number" done echo "total $number in this folder"