We could use find + xargs to make it happen.

For example, I would like to delete file with file name “.DS_Store” and “._” we could execute the code like below

find . -name ".DS_Store" -print0 | xargs -0 rm -rf 
find . -name "._*" -print0 | xargs -0 rm -rf

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>