Most of those rmThese commands should've workeddidn't work because wildcard patterns omit dot files (notfiles whose name begins with the character .) unless the dot appears explicitly in the pattern. So *.unun~ matches yourfile.txt.un~ but not .myfile.txt.un~, since that doesn't matchwhereas .*.un~), so if they didn't you might have some other problem does match .myfile.txt.un~. In any case, you
You should be able to use find(1) for this (find wildcard matching doesn't treat dot files specially):
find / -name "*.un~" -not -path "~/.tmp/*" -delete That tells find to search / for all files matching *.un~ that aren't in ~/.tmp and delete them. If you take off -delete it will just output a list, so you can check and make sure it's not going to delete the wrong things. You also might want to throw -mount in there to stop it from searching other filesystems you have mounted