A script to find which directories have certain types of files with directory and file names having special characters (spaces, parentheses, brackets...). #dirs-with-spaces #while-read-loop #bash
#!/bin/bash
while read
do
count=`find "$REPLY" -iname "$2"|wc -l`
if [ "$count" -gt "0" ]; then
echo "$REPLY"
fi
done < <(find $1 -mindepth 2 -maxdepth 2)