尝试将文件移动到主目录时,我不小心将文件命名为〜.现在在我的/中有一个名为〜的文件,我不知道如何删除它.
解决方法:
将文件名放在引号中:
rm '~'
您可以按照bash手册进行操作:
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. …