Delete a list of files with find and grep

find . -name '*car*' -exec rm -f {} \;

or pass the output of your pipeline to xargs:

find | grep car | xargs rm -f

Note that these are very blunt tools, and you are likely to remove files that you did not intend to remove. Also, no effort is made here to deal with files that contain characters such as whitespace (including newlines) or leading dashes. Be warned.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)