I just noticed that I've got a mysterious file simply called ~ in the root of my harddrive. I suspect that I've created it by accident while using terminal.
I know about using ~ as an alias to quickly get to the current user and I use it extensively, so there is a reasonable chance that I've been wanting to create a new file and possibly been in the process of writing something in the lines of touch ~/new_file
but changed my mind and accidentally pressed enter after touch ~
?
But that does not explain the fact that the file is 3.1MB?
Furthermore, the file appears as a file in Finder, but if I try doing either cat ~
or vim ~
on it in terminal I'm told that it is actually a directory. But doing an ls -l
suggests something else:
-rw------- 1 root wheel 3.0M Apr 3 13:37 ~
And have a look at the creation date ...today at 13:37 (ie. LEET).
I discovered that there are a couple of threads where people experience the same thing and the answer seems to be some application failing to write to the user directory, but the timestamp is what makes me suspicious (tin foil hat?).
- Could this be something malicious?
- Can I log what or who wrote the file somehow?
- Can I figure out what's inside it?
- How can I make sure it is safe to delete this file/directory or whatever it is?
Edit: Regarding this question being marked as a duplicate, I explicitly mention that I've read the original thread and none of my four questions above have been answered in that thread, so please read the entire question before flagging.
sudo
, e.g.,sudo cat /~
?sudo
does not change anything. I'm using oh-my-zsh as my shell and I'm running Yosemite (10.10.2).