简体   繁体   中英

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. It looks like it was created by accident, but when trying to use "rm name_of_file" I get the following error:

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? Alternatively, just use wildcards:

ls *how*
rm *how*

Option 1:

Use escape characters.

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

Option 2:

Deleting through inum value

find . -inum | <operation>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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