gogogadgetinternet
gogogadgetinternet

Reputation: 6089

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

Upvotes: 0

Views: 210

Answers (2)

Srini V
Srini V

Reputation: 11355

Option 1:

Use escape characters.

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

Option 2:

Deleting through inum value

find . -inum | <operation>

Upvotes: 2

admdrew
admdrew

Reputation: 3863

Have you tried using tab to autocomplete the file name? Alternatively, just use wildcards:

ls *how*
rm *how*

Upvotes: 2

Related Questions