Find files and save a text file named “script.sh”:

find . | xargs grep -l "text string here" | awk '{print "rm "$1}' > script.sh

Then chmod +x the file and run. Solution found in Stack Overflow.

Facebooktwitterredditpinterestlinkedinmail