If the folder structure is:
parentFolder
├── file1.rtf
├── file2.rtf
... #there are many more files.
├── moreFiles.rtf
├── subFolder1
├── subFolder2
├── subFolder3
... #there are many more subfolders.
└── moreSubFolders
How would I delete all subfolders except subFolder1
without deleting any of the files?
I do not want to have to name each folder which should be deleted.
I also do not want to have name each file which should not be deleted.
I want a command that only deletes folders, not files, and allows the user to exclude some folders from being deleted.
rm -rf parentFolder/subFolder1
?