#!/bin/bash for folder in threads/*; do echo "$folder $(ls $folder | wc -l)"; done