1 2 3 |
# q = quiet; that means that grep will exit with status "0" (success) # if a file contains either word "some" or word "text" find . -type f -exec bash -c "grep -q -e some -e text {} && echo {}" \; |
Find all files which contain specific text and print these file names to the console
If a file contains either word “some” or word “text” then print its name