Skip to content

Instantly share code, notes, and snippets.

@mikedugan
Created November 7, 2013 14:58
Show Gist options
  • Save mikedugan/7355973 to your computer and use it in GitHub Desktop.
Save mikedugan/7355973 to your computer and use it in GitHub Desktop.
recursively count files in a dir
$!/bin/bash
find . -type d -print0 | while read -d '' -r dir; do
files=("$dir"/*)
printf "%5d files in directory %s\n" "${#files[@]}" "$dir"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment