Change the IP address and connect with it

I would like to search particular words in specific files by using grep command
example:
file1.txt
this is denver

file2.txt
denver is good city to live in

file3.txt
this is situated in Colorado
please correct me wherever I am wrong

find . -name “file*.txt” | grep -w “denver”

If you want to pipe find with another command, you have to use the “exec” option, try this:

find . -name "file*.txt" -exec grep -w "denver" {} \;
2 Likes

Try this too, hope it will work out…

 # grep -w "denver" $(find . -name "file*.txt)
1 Like