To find all file paths with .out extension in subdirectories, I use
find . -name '*.out'
To grep a pattern in all files ending in .out, I use
grep pattern *.out
How do I combine these two commands, so that it finds all files and then greps in those files?
I am looking for an elegant alternative to
grep -r 'pattern' . | grep '.out'