I am trying to test this scenario, I have these files
/encoded encode <~~~ a bash script /dir1 /dir2 .../dir2-sub test.meta
what I wish is, for
find to search for all directories in our current (except) encoded, then delete all of them
I ended up using this script:
find . -name encoded -prune -o -maxdepth 10 ! -name 'encode*' ! -name '.*' | xargs rm -rf
what I believe it would do is, mark the folder
-prune it, so it would ignore it, right?
then for any other, which does not have extension(which makes sure all of them are dir) delete it via
but the problem is... I also have a bash script without extension name, so it ended up getting deleted
what i wish is my bashscript to end up from the structure above to exactly like this one (keeping all non-dir intact, don't touch /encoded folder and its contents, and don't delete encode bash script)
/encoded encode <~~~ a bash script test.meta
how can I get the result above?