In a directory
find . -name “*ABC*” -exec grep -H ‘XYZ’ {} +
This essentially uses find to find the file, then -exec grep will search IN all the matching files for the string you specified.
bit by bit
In a directory
find . -name “*ABC*” -exec grep -H ‘XYZ’ {} +
This essentially uses find to find the file, then -exec grep will search IN all the matching files for the string you specified.