I need to delete all sub directories and their contents in a given folder, whilst leaving a particular sub directory. Is there a way to do this using bash or a shell script? The file structure is shown below.
container_dir
│
├── delete_this_dir
│ ├── file1.txt
│ └── file2.txt
│
├── delete_this_dir
│ ├── l1.txt
│ └── l2.txt
│
└── keep_this_dir
├── file1.txt
├── file2.txt
└── file3.txt