linux remove all in directory code example Example: delete all folders except one linux find * -maxdepth 0 -name 'b' -prune -o -exec rm -rf '{}' ';'