rm except 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")
Example 3: rm except file
$ find . -type f -not \(-name '*gz' -or -name '*odt' -or -name '*.jpg' \) -delete