I want to delete all the files in the directory with the given name, except for one with the given extension. That is, 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 the main thing, I do not want to get rid of foo.exe
Is there a simple liner for this?
thanks
source share