Delete all files of a directory which contains a specific contents, no mather the size of the directory

/ Published in: Bash
Save to your folder(s)

Copy this code and paste it in your HTML
  1. find . -exec grep -l "From: MAILER-DAEMON" {} \; | xargs rm -rvf '{}'

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.