delete the file inside the directory except the the particular file c# code example
Example 1: delete all the files without one in linux
# delete all except the filename
$ rm -v !("filename")
Example 2: bash delete everything except
$ rm -v !("filename1"|"filename2")