If you want to quickly delete all but one of the items in a particular folder here is one way to do it at the shell:
assuming a directory that contains the following contents:
1 2 3
I can get rid of all the files except 5.txt as follows:
All that is going on here is that I am making use of both subshells and pipes to first list the contents of everything in the directory, which then pipes through to the grep command which return all of the items that don’t match 5.txt. That set of items then gets acted on by the containing shell which removes each of the non matching items.