Shell – How to remove every file that has x in its title

findshellzsh

I have a lot of directory where there are hundreds of files.

In every directory there are pairs of my_file-01.jpg and my_file-€01.jpg

I want to remove every file that contains € sign in its title: how to do that?

Best Answer

find does the job:

find . -iname "*€*" -delete gets rid of all files whose name matches "", be careful, find goes into subdirectories as well, if you don't want that you have to tune the find params a little

Related Question