I want to delete all files in a directory with a given name, except for one with a given extension. I.e. we have a directory with:
foo.txt foo.exe foo.jpg foo.png foo.something foo.somethingelse bar.jpg bar.exe
I want to get rid of foo.txt foo.jpg foo.png foo.something foo.somethingelse
BUT crucially I don't want to get rid of foo.exe
Is there an easy one liner to do this?
Thank you