This question already has an answer here:

A directory named ~ appeared in a folder under ~/Projects/myproject/~.


ls -al ~/Projects/myproject
drwxr-xr-x   3 myuser  staff      102 20 Sep 11:32 ~

I don't want to try removing it with rm because I have a feeling it will remove my whole home dir.

Is there any safe way to get rid of it, or any ideas on how it got there in the first place?

marked as duplicate by Community Sep 20 '16 at 9:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • try rm -i ? and confirm. – Archemar Sep 20 '16 at 9:22

You can explicitly indicate the ~ file on current directory by preceding it with ./:

cd ~/Projects/myproject
rm ./~

Or just use the full path:

rm ~/Projects/myproject/~

Not the answer you're looking for? Browse other questions tagged or ask your own question.