Delete files with string found in file - linux cli
I am trying to delete erroneous emails based on finding the email address in the file via Linux CLI. I can get the files with find . | xargs grep -l email@domain.com But I cannot figure out how to delete them from there as the following code doesn't work. rm -f | xargs find . | xargs grep -l email@domain.com Thank you for your assistance. For safety I normally pipe the output from find to something like awk and create a batch file with each line being "rm filename" That way you can check it before actually running it and manually fix any odd edge cases that are difficult to do with a regex