delete all the files without one in linux

C++
# delete all except the filename

$ rm -v !("filename")

Source

Also in C++: