How can I delete this file?

I accidentally created a file called ~ on a linux installation.

Everytime I try to run rm ~ it says I cannot delete /root/ . So how the hell can I delete this file? :rofl::rofl::rofl::rofl::rofl:

find the inode of the file:

ls -li

then delete the file using inode:

find . -inum <inode-number> -exec rm -i {} \;

This is really interesting behavior. If you were to create a malicious file called ~, I wonder what ClamAV would do匈 would suspect it wouldnt be able to delete the file.

It would be an interesting test, but I am sure someone has thought of that before as there are other characters that cause issues like ?