I was going through my desktop in Linux and I noticed a list of files that were not on my desktop. They are Microsoft word(.doc & .docx) files that exist on my computer elsewhere. For some reason they are showing up on my desktop(in UNIX environment). They start with '~$' and the first two letters of file names are cut off. For example if the file name is filename.docx, it would show as ~$lename.docx. How can I remove these files?
rm ~$lename.docx, the shell sees
$lename and tries to expand it to the contents of the likely non-existent variable
lename, so the command ran is actually something like
rm ~.docx. You'll have to quote it so that the shell doesn't try to do that:
Alternatively, if you have multiple such files, you can use shell globbing (wildcards), assuming all such filenames begin with
~$ and end with