ubuntu remove all folders but keep some code example
Example: ubuntu remove all folders but keep some
find ./myfolder -mindepth 1 ! -regex '^./myfolder/test2\(/.*\)?' -delete
find ./myfolder -mindepth 1 ! -regex '^./myfolder/test2\(/.*\)?' -delete