How would I delete everything in a directory except for three specified directories?
So far I discovered I can omit the directories like so in a find search:
find . -type d \( -name media -o -name images -o -name backups \) -prune -o -print
But if I pass the '-delete' parameter, I get the error:
find: The -delete action atomatically turns on -depth, but -prune does nothing when -depth is in effect. If you want to carry on anyway, just explicitly use the -depth option.