I would like to delete all files that contains " (2)" –whitout the quotes– in the file names. I tried first with ls to test
ls *(2)*
and list all the files in the folder
ls "*(2)*"
don't list any file, how I have to format the wildcard to do the right thing?
Thanks
Best Answer
You need to escape (or quote) the parentheses - but not the glob wildcards
*
e.g.or
or even
If you want to match the leading space explicitly, you will need to escape or quote that as well e.g.
or