User Tools

Site Tools


grep_on_find_results

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
grep_on_find_results [2021/04/08 10:13] rajugrep_on_find_results [2021/04/08 10:17] raju
Line 3: Line 3:
 find . -iname '*.py' -exec grep something -inH --color {} + find . -iname '*.py' -exec grep something -inH --color {} +
 </code> </code>
 +
 The output can be redirected to a file The output can be redirected to a file
 <code> <code>
 find . -iname '*.py' -exec grep something -inH --color {} + > output.txt find . -iname '*.py' -exec grep something -inH --color {} + > output.txt
 +</code>
 +
 +Another solution is to use xargs
 +<code>
 +find . -iname '*.py' -print0 | xargs -0 grep something -inH --color
 </code> </code>
  
grep_on_find_results.txt · Last modified: 2021/04/08 10:30 by raju