I could envision a simple shell script that would accomplish what I want by just iterating through a list of files in a directory and summing the individual size but was wonderi
You can use this function :
dir () { ls -FaGl "${@}" | awk '{ last_size += $4; print }; END { print last_size }'; }
also you can use this command this is shorter and give you better result!
find YOUR_PATH -type f -name '*.jpg' -exec du -ch {} +