find . -type d -regextype sed -regex ".*some_pattern.*" -exec sh -c 'grep -Ril "find_it" $0' {} \;

What I want to achieve here is to narrow down a number of folders against which grep should be run. Apparently, my example doesn't work and fails with

find: sh: Key has expired

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.