Read about the security considerations for find. Find is a *nix tool for searching though directories for files and filtering them to build lists or run commands.
While I’m here I might as well show you my latest find command, I think it’s a beauty. :)
sudo find . \ \( \( \( \! -user jj5 \) -or \( \! -group jj5 \) \) \ -execdir chown jj5:jj5 '{}' \+ \) , \ \( \( -type d \( \! -perm -u+rwx \) \) \ -execdir chmod u+rwx '{}' \+ \) , \ \( \( -type f \( \! -perm -u+rw \) \) \ -execdir chmod u+rw '{}' \+ \)