a file named "~" on /

AVmcclint
Honored Contributor

I did a fresh image of a Mac this morning... same process I've done a hundred times before. The only difference is that after the imaging and post-imaging was complete, I ran Software Update and told it to install Security Update 2015-004, Safari 9.0.1, and iTunes 12.3.1 all at the same time. (Usually I do them one at a time.) After the updates and the reboot, I looked on the hard drive and I saw a file named "~" (no quotes). It's a binary file that's about 1.6MB in size and it is visible in the Finder.

ls -la /
[...]
-rw-------    1 root  wheel  1572864 Nov 12 09:33 ~

I've never seen this appear on any Macs I've ever imaged or updated. I've rebooted a couple times just in case maybe some process needed to do some cleanup, but it still remains. Does anyone know where this file came from or if it's safe to delete?

As you can imagine, doing a search for /~ on the internet isn't very useful in this case.

2 REPLIES 2

thoule
Valued Contributor II

Sounds like a script put that there by mistake. Yeah it should be deleted. You can try to get some info from it if you want of course. Rename it to something easier to manage then try a few things (test box only)

head -50 /sillyfilename |more
sudo strings /sillyfilename
./sillyfilename --help  
dtruss -n ./sillyfilename

mm2270
Legendary Contributor III

Or you can sometimes pull the file into an app like TextWrangler to see if its readable. It does sound like a poorly developed script dropped that there. I have seen similar odd things on occasion, although not strictly with a ~ as the name.