Last active
August 18, 2023 10:41
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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