it.delete() println "t${it.name} deleted." } } println "Matching Files:" directory.eachFileRecurse(findFilenameClosure) I simply changed the closure to delete the files with matching names. The output ...