You can combine
find . -type f -a -name delme_files -print0 | xargs -0 rm
find . -type d -a -name delme_dir -print0 | xargs -0 rmdir
(when you are in the
There is probably a way to combine the two
find into only one but I find it clearer like that anyway.
find commands will find the directories/files named per your example, and you pipe the results to
xargs that will execute
rm (remove) /
rmdir (remove directory) on each of the file find "upstream", that is from the
If the directories are not empty, replace
rm -Rf but this will remove recursively all files in the directories found by the
-0 will make sure that all files/directories will be dealt correctly, even those having spaces in their names (maybe not needed here but better to use in generic cases).
Make sure to test things before on non important data and always have backups.