Hi
I have a folder that contain up to 1000 subfolder. Genereally i need just 2 or 3 of them and i can know apriori the name of the subfolder i want to keep.
I'd like to erase all the unnecessary subfolders.
I've tried with:
ls -l | awk '$8 !~ /name_fold/{print "rm -r " $8}'| sh
and it works becouse i keep the name_fold1 ...but just for 1 folder, I'd like to do something like:
ls -l | awk '$8 !~ /name_fold1 || name_fold2 /{print "rm -r " $8}'| sh
in order to erase almost all and kepp the name_fold1 and name_fold2
Any idea?
thanks
D