Here is the situation.
I have a directory which contains many files with different extensions. I want to delete all files except one with a specific name.
This could be easily done using the GUI by selecting all and pressing ctrl and deselecting the file in question.
That is exactly what I want to, but how can I do it from the command line?
For example: dirA contains the following files:
a.txt
b.txt
c.php
d.html
a.db
b.db
e.html
I want to delete all files keeping only the file named a.txt
.