Skip to content

Instantly share code, notes, and snippets.

@diversit
Created August 23, 2018 07:16
Show Gist options
  • Save diversit/9f62b0e67f178bce8ba9b163f4de839d to your computer and use it in GitHub Desktop.
Save diversit/9f62b0e67f178bce8ba9b163f4de839d to your computer and use it in GitHub Desktop.
count-files-per-folder.sh
# Loop over folders and count the files in the folder
find . -maxdepth 1 -mindepth 1 -type d | while read dir; do
printf "%-25.25s : " "$dir"
find "$dir" -type f | wc -l
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment