Created
March 22, 2025 06:00
-
-
Save ubuntupunk/7359068d382d3b468b3ed4c1c496636a to your computer and use it in GitHub Desktop.
findgrep
This file contains 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
** Using a shell function in your .bashrc (recommended approach): | |
```bash | |
findgrep() { | |
find . -type f -exec grep -l "$1" {} \; | |
} | |
``` | |
*** Or even simpler, you can use grep -r directly (more efficient): | |
```bash | |
findgrep() { | |
grep -r -l "$1" . | |
} | |
``` | |
After adding either of these to your .bashrc, you can use it like: | |
```bash | |
findgrep "onRetry" | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment