Terminal command for removing all named files except for one In Terminal.app, how can I delete all files of a certain name except for one extension?  For example if I have:

File.docx
File.ppt
File.pdf
File.xlsx
File.out
File.app
FIle.otherextension
File2.docx
File2.ppt
File2.pdf
File2.xlsx
File2.out
File2.app
FIle2.otherextension


all in one directory, how can I delete all of the File ones except for File.out?  

Expected ls output at the end:

File.out
File2.docx
File2.ppt
File2.pdf
File2.xlsx
File2.out
File2.app
FIle2.otherextension
The following will delete all files named File (and only those) within the current folder, except ones with extension .out:

find . -type f \( -iname "File.*" ! -iname "*.out" \) -delete -maxdepth 1

If you want to perform this operation recursively (traversing all subfolders), remove -maxdepth 1:

find . -type f \( -iname "File.*" ! -iname "*.out" \) -delete

The i in -iname performs a case-insensitive search, so file.*, FILE.*, etc. will be deleted as well. Likewise, file.OUT would be spared.