I have a nested folder structure containing lots of folders and files.
How do I search inside files for a pattern eg "sampletext", but only if the filename matches a pattern (eg only search inside files with .txt extension) and finally the containing folder name must match another pattern? (eg "data").
I'm sure I could write a shell script to do it, but I'm sure clever one-liners exist that will teach me new things!
Thanks in advance