Skip to content

Instantly share code, notes, and snippets.

@Guitsou
Created August 16, 2013 13:27
Show Gist options
  • Save Guitsou/6249973 to your computer and use it in GitHub Desktop.
Save Guitsou/6249973 to your computer and use it in GitHub Desktop.
#!/bin/bash
# count_em - count files in all subdirectories under current directory.
echo 'echo $(ls -a "$1" | wc -l) $1' >/tmp/count_em_$$
chmod 700 /tmp/count_em_$$
find . -mount -type d -print0 | xargs -0 -n1 /tmp/count_em_$$ | sort -n
rm -f /tmp/count_em_$$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment