So, on a CentOS box, I accidentally executed :w<Down>
in a vim
editor, with "<Down>
" being literally pressing the down arrow key on the keyboard (rendered onscreen as "<Down>
"), and now I have a file named "<Down>
" which I can't seem to get rid of; running "rm <Down>
" (literally spelling out "less-than, D, o, w, n, greater-than") gives a syntax error.
How can I get rid of this file with the funky name?
Use singlequotes to keep the control characters from being processed:
Use \ to escape special characters. In this case, you would use
As an alternate solution:
The easiest way I found to deal with all cases of escaping is using a scripting language:
type rm
<D
and then press TAB , it will show suggestions, for the name of the desired file..