delete all file from location except 1 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")
# delete all except the filename
$ rm -v !("filename")
$ rm -v !("filename1"|"filename2")