Search code examples
linuxgitfile-managementrm

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

Solution

  • Option 1:

    Use escape characters.

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

    Option 2:

    Deleting through inum value

    find . -inum | <operation>