简体   繁体   English

在Linux中-如何删除名称错误的文件?

[英]In Linux - how do I delete a file with an 'erroneous' name?

I have a file that keeps popping up in my git status log. 我有一个文件不断在我的git status日志中弹出。 It looks like it was created by accident, but when trying to use "rm name_of_file" I get the following error: 看起来它是偶然创建的,但是在尝试使用“ rm name_of_file”时出现以下错误:

rm: cannot remove `name_of_file': No such file or directory

Here's the actual filename: 这是实际的文件名:

how
2d02b0b06030126e194e178ce2493a2de30144c7\033[1~q

Have you tried using tab to autocomplete the file name? 您是否尝试过使用Tab键自动完成文件名? Alternatively, just use wildcards: 或者,只需使用通配符:

ls *how*
rm *how*

Option 1: 选项1:

Use escape characters. 使用转义字符。

rm -f "how\ 2d02b0b06030126e194e178ce2493a2de30144c7\\033[1~q"

Option 2: 选项2:

Deleting through inum value 删除inum值

find . -inum | <operation>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM