So, Im working in a UNIX environment and I noticed that inside my working directory, which is miles miles away from my UNIX home, there is a ~
.
Now, once in the past, I did rm -rf ~
from my working directory and ended up erasing my home directory completely and had to involve IT.
I do not want to do it again. At the same time, I want to know
Why is
~
created in my working directory? Is it a faulty finger slip while saving (:w!
but what happens is:w~
?!!)Before checking in, there is a script that looks for extra files or folders that p4 is not aware so def this
~
might cause an issue. So how can I remove the~
from my working directory and at the same time not erase my home?
I do have a backup command called del
that I use instead of rm -rf
. It just places stuff in a temporary location. I could use that and get rid of the ~
. But I'm more interested in knowing why this happens, and how I can remove it?
/home/yourUserName/~
to access the directory called~
. – jofel 17 hours ago