Skip to content

Instantly share code, notes, and snippets.

@ubuntupunk
Created March 22, 2025 06:00
Show Gist options
  • Save ubuntupunk/7359068d382d3b468b3ed4c1c496636a to your computer and use it in GitHub Desktop.
Save ubuntupunk/7359068d382d3b468b3ed4c1c496636a to your computer and use it in GitHub Desktop.
findgrep
** 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