I think, like me, you would have faced a lot of situations, where you wanted to delete all the files or directories in a location, leaving only the required files/directories. So, I have a directory containing lots of files/directories and I want to delete most of them except some 5/10 of them, how to I do it.
I finally wrote a small script to do that. First save list of files that you do not want to delete in file called “listnames” and then execute the below script.
Continue reading