git grep
Here is the syntax using git grep combining multiple patterns using Boolean expressions:
git grep -e pattern1 --and -e pattern2 --and -e pattern3
The above command will print lines matching all the patterns at once.
If the files aren't under version control, add --no-index param.
Search files in the current directory that is not managed by Git.
Check man git-grep for help.
See also:
- How to use grep to match string1 AND string2?
- Check if all of multiple strings or regexes exist in a file.
- How to run grep with multiple AND patterns?
- For multiple patterns stored in the file, see: Match all patterns from file at once.