删除名为〜的文件 [英] Removing a file called ~

查看:70
本文介绍了删除名为〜的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试将文件~移到主目录时,我不小心将其命名为.现在在我的/中有一个名为~的文件,我不知道如何删除它.

I accidentally named a file ~ when I was trying to move it to my home directory. And now in my / there is a file called ~ and I have no idea how I would remove it.

如何删除意外重命名为~的文件?

How would I remove a file that I accidentally renamed ~?

推荐答案

将文件名放在引号中

rm '~'

您可以按照bash手册进行操作:

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. ...

这篇关于删除名为〜的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆