Removing a file called ~ [closed]

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 01:11:39

Put the filename in quotes:

rm '~'

You can follow the bash manual:

https://www.gnu.org/software/bash/manual/html_node/Tilde-Expansion.html

If a word begins with an unquoted tilde character (‘~’), all of the characters up to the first unquoted slash (or all characters, if there is no unquoted slash) are considered a tilde-prefix. ...

You could just use a backslash to remove it.

 rm \~
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!