Skip to content

Instantly share code, notes, and snippets.

@alimbada
Last active August 18, 2023 10:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alimbada/1b6c2e9f9037d8d370349cc67238d622 to your computer and use it in GitHub Desktop.
Save alimbada/1b6c2e9f9037d8d370349cc67238d622 to your computer and use it in GitHub Desktop.
Run a command on directories containing $file with exclusion for directories named $dir
find . -type d -name $dir -prune -o -name '$file' -execdir pwd \;
# Example: find . -type d -name node_modules -prune -o -name 'package.json' -execdir npm install \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment