by

How to grep the results of find using -exec in Linux

This Linux one line command is useful when you want to grep the output of a find.

The concatenation of grep and find is done via -exec parameter.
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/458993/How-to-grep-the-results-of-find-using--e?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
find . -name *.xml -exec grep -e my_grep_data {} \; -print
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus