Hi,
I believe the following should do the trick:
Code:
find ./ -wholename './obsolete/*' -exec echo "rm -rf" {} ';'
It basically says to delete all the subdirectories and files of ./obsolete. Remove the echo when you think it gives the correct output.
Edit:
Eh, I just saw that is not what you want, obsolete may also appear somewhere in the directory structure, right? Then '*/obsolete/*' should do it, if I am not mistaken.
Edit2:
No, that won't do it either, that will also remove the whole path from your current directory to the obsolete directory. Mhh, not as simple as I thought.
Edit3:
The version from pengrath below should work, but it did not really appeal to me, so this is what I came up with instead; borrowing his approach though.
Code:
find . -name obsolete -prune | while read content; do rm -rfv ${content}/*; done
This one actually works.
Regards,
bytepool