linux 删除文件反选 # shopt -s extglob (打开extglob模式) # rm -rf !(file1) 如果是多个要排除的,可以这样: # rm -rf !(file1|file2)