This page contains some handy shell script snippets.
find . -type d -name '__pycache__' -prune -print
find . -type d -name '__pycache__' -prune -exec rm -rf {} +