I have a directory that has tons of files, and they are named with GUID names.
There are only 3 files in there that I want to keep, and I don't want to move them or anything as the OS might be using them.
How can I delete ALL files in a folder, except for 2 folders and 1 file?
Ctrl, unselect those that you want to keep, and delete the rest? Or do you want a command line solution? – slhck Oct 30 '11 at 15:11mkdir ../tmp ; mv dir1 dir2 file1 ../tmp ; rm * ; mv ../tmp/* . ; rmdir ../tmp. If there are subdirs, make thatrm -r *. – ott-- Oct 30 '11 at 16:22