Skip to content

Instantly share code, notes, and snippets.

@bicccio
Last active February 4, 2017 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bicccio/ee7033553f3285915b4d34a9ec0ad765 to your computer and use it in GitHub Desktop.
Save bicccio/ee7033553f3285915b4d34a9ec0ad765 to your computer and use it in GitHub Desktop.
count howthe number of files inside each subdirctory
#! /bin/bash
dir=$1
find $dir -type d -maxdepth 1 -mindepth 1 -print0 | while IFS= read -r -d $'\0' line; do
echo "$line"
ls -R "$line" | wc -l
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment