I have a directory containing a large number of files. I want to delete all files except for file.txt . How do I do this?
There are too many files to remove the unwanted ones individually and their names are too diverse to use * to remove them all except this one file.
Someone suggested using
But it doesn't work. It returns:
Badly placed ()'s
My OS is Scientific Linux 6.
.gitdirectory, see: stackoverflow.com/a/22347541/565877