I just realized that I have tons of Vim undo (
.un~) files sprinkled around my file system. I'd like to delete all of these files except in one directory—
~/.tmp. My first problem is that I can't seem to find a Unix command to delete these things. For example, I have a file name that looks like this:
rm -f *.un,
rm -f *.un\~,
rm -f *.un*, etc. and I can't seem to find any command that can delete these files. How can I delete these files?
Secondly, I'd like to write a command with find that can visit all my directories and delete these files, with the exception of the
~/.tmp directory. I'm quite afraid of executing this command incase it's wrong. Can anyone help be construct a find command to do this? Thanks in advance for the help!