I've written a short script to traverse a directory tree and count the number of occurrences of a specific file type. Script as follows:
Code:
#!/bin/bash
find -type d | while read dir; do
count=$(find "$dir" -iname \*.cue | wc -l)
echo "$dir $count"
done
When run find chokes on certain folder names e.g.:
Code:
find: ‘./G/Genesis - Abacab [1993 24k Gold Original Master Edition]’: No such file or directory
I recall coming across and solving this many years back, but the answer escapes me now. Any help/ insights appreciated.